Skip to content
Snippets Groups Projects
Unverified Commit 89d3d7b2 authored by Erik Johnston's avatar Erik Johnston Committed by GitHub
Browse files

Merge pull request #5221 from matrix-org/erikj/fix_worker_sytest

Fix get_max_topological_token to never return None
parents 8f06344e 7f08a352
No related branches found
No related tags found
No related merge requests found
Fix race when backfilling in rooms with worker mode.
......@@ -592,8 +592,18 @@ class StreamWorkerStore(EventsWorkerStore, SQLBaseStore):
)
def get_max_topological_token(self, room_id, stream_key):
"""Get the max topological token in a room before the given stream
ordering.
Args:
room_id (str)
stream_key (int)
Returns:
Deferred[int]
"""
sql = (
"SELECT max(topological_ordering) FROM events"
"SELECT coalesce(max(topological_ordering), 0) FROM events"
" WHERE room_id = ? AND stream_ordering < ?"
)
return self._execute(
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment