diff options
author | Erik Johnston <erik@matrix.org> | 2018-05-21 17:40:10 +0100 |
---|---|---|
committer | Erik Johnston <erik@matrix.org> | 2018-05-31 10:18:40 +0100 |
commit | bf599cdba1e708a182469e84754d6e1f063f1c7e (patch) | |
tree | 8b1798c70a99f73eab7018a579c2a123f1c43a33 | |
parent | Add chunk ID to pagination token (diff) | |
download | synapse-bf599cdba1e708a182469e84754d6e1f063f1c7e.tar.xz |
Use calculated topological ordering when persisting events
-rw-r--r-- | synapse/storage/events.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/synapse/storage/events.py b/synapse/storage/events.py index 5194c4a48d..d38f65b4e6 100644 --- a/synapse/storage/events.py +++ b/synapse/storage/events.py @@ -1020,7 +1020,7 @@ class EventsStore(EventsWorkerStore): } ) - chunk_id, _ = self._insert_into_chunk_txn( + chunk_id, topo = self._insert_into_chunk_txn( txn, event.room_id, event.event_id, [eid for eid, _ in event.prev_events], ) @@ -1032,6 +1032,7 @@ class EventsStore(EventsWorkerStore): updatevalues={ "outlier": False, "chunk_id": chunk_id, + "topological_ordering": topo, }, ) @@ -1117,9 +1118,9 @@ class EventsStore(EventsWorkerStore): for event, _ in events_and_contexts: if event.internal_metadata.is_outlier(): - chunk_id, _topo = None, 0 + chunk_id, topo = None, 0 else: - chunk_id, _topo = self._insert_into_chunk_txn( + chunk_id, topo = self._insert_into_chunk_txn( txn, event.room_id, event.event_id, [eid for eid, _ in event.prev_events], ) @@ -1130,7 +1131,7 @@ class EventsStore(EventsWorkerStore): values={ "stream_ordering": event.internal_metadata.stream_ordering, "chunk_id": chunk_id, - "topological_ordering": event.depth, + "topological_ordering": topo, "depth": event.depth, "event_id": event.event_id, "room_id": event.room_id, |