mirror of
https://github.com/element-hq/synapse.git
synced 2024-11-22 09:35:45 +03:00
Prefer simple_delete_many_txn
See https://github.com/element-hq/synapse/pull/17512#discussion_r1726819380
This commit is contained in:
parent
980ee9aad6
commit
6723824c4a
1 changed files with 6 additions and 7 deletions
|
@ -1761,13 +1761,12 @@ class PersistEventsStore:
|
|||
#
|
||||
# This would only happen if someone was state reset out of the room
|
||||
if sliding_sync_table_changes.to_delete_membership_snapshots:
|
||||
txn.execute_batch(
|
||||
"DELETE FROM sliding_sync_membership_snapshots"
|
||||
" WHERE room_id = ? AND user_id = ?",
|
||||
[
|
||||
(room_id, user_id)
|
||||
for user_id in sliding_sync_table_changes.to_delete_membership_snapshots
|
||||
],
|
||||
self.db_pool.simple_delete_many_txn(
|
||||
txn,
|
||||
table="sliding_sync_membership_snapshots",
|
||||
column="user_id",
|
||||
values=sliding_sync_table_changes.to_delete_membership_snapshots,
|
||||
keyvalues={"room_id": room_id},
|
||||
)
|
||||
|
||||
# We do this regardless of whether the server is `no_longer_in_room` or not
|
||||
|
|
Loading…
Reference in a new issue