Skip to content
This repository was archived by the owner on Apr 26, 2024. It is now read-only.

Commit 2110d23

Browse files
committed
Moar fixups
1 parent c226da4 commit 2110d23

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

synapse/storage/databases/main/events_bg_updates.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -751,7 +751,9 @@ def _get_event_ids(txn: Cursor) -> List[Tuple[str, int, int]]:
751751
sql = """
752752
SELECT event_id, topological_ordering, stream_ordering FROM events
753753
INNER JOIN state_events USING (event_id)
754+
LEFT JOIN event_auth_chains USING (event_id)
754755
WHERE events.room_id = ? AND (topological_ordering, stream_ordering) > (?, ?)
756+
AND event_auth_chains.event_id IS NULL
755757
ORDER BY topological_ordering, stream_ordering
756758
LIMIT ?
757759
"""
@@ -767,7 +769,7 @@ def _get_event_ids(txn: Cursor) -> List[Tuple[str, int, int]]:
767769
event_ids, redact_behaviour=EventRedactBehaviour.AS_IS, allow_rejected=True
768770
)
769771

770-
await self.runInteraction(
772+
await self.db_pool.runInteraction(
771773
"_chain_cover_index_info",
772774
self.hs.get_datastores().persist_events._add_chain_info,
773775
events,

0 commit comments

Comments
 (0)