Merge pull request #3435 from matrix-org/rav/fix_event_push_actions_tablescan
Fix event_push_actions tablescan when reinserting eventspull/3282/merge
commit
516f884176
|
@ -1044,7 +1044,6 @@ class EventsStore(EventsWorkerStore):
|
||||||
"event_edge_hashes",
|
"event_edge_hashes",
|
||||||
"event_edges",
|
"event_edges",
|
||||||
"event_forward_extremities",
|
"event_forward_extremities",
|
||||||
"event_push_actions",
|
|
||||||
"event_reference_hashes",
|
"event_reference_hashes",
|
||||||
"event_search",
|
"event_search",
|
||||||
"event_signatures",
|
"event_signatures",
|
||||||
|
@ -1064,6 +1063,14 @@ class EventsStore(EventsWorkerStore):
|
||||||
[(ev.event_id,) for ev, _ in events_and_contexts]
|
[(ev.event_id,) for ev, _ in events_and_contexts]
|
||||||
)
|
)
|
||||||
|
|
||||||
|
for table in (
|
||||||
|
"event_push_actions",
|
||||||
|
):
|
||||||
|
txn.executemany(
|
||||||
|
"DELETE FROM %s WHERE room_id = ? AND event_id = ?" % (table,),
|
||||||
|
[(ev.event_id,) for ev, _ in events_and_contexts]
|
||||||
|
)
|
||||||
|
|
||||||
def _store_event_txn(self, txn, events_and_contexts):
|
def _store_event_txn(self, txn, events_and_contexts):
|
||||||
"""Insert new events into the event and event_json tables
|
"""Insert new events into the event and event_json tables
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue