summary refs log tree commit diff
path: root/synapse/storage/event_federation.py
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2015-05-21 15:46:07 +0100
committerErik Johnston <erik@matrix.org>2015-05-21 15:46:07 +0100
commitae3bff349151d8f309bdf29fd258b215cb792e90 (patch)
tree373e88ec65ea0531a9a34959554a5cd2f08d54de /synapse/storage/event_federation.py
parentDon't prepopulate event_results (diff)
downloadsynapse-ae3bff349151d8f309bdf29fd258b215cb792e90.tar.xz
Correctly prepopulate queue
Diffstat (limited to 'synapse/storage/event_federation.py')
-rw-r--r--synapse/storage/event_federation.py12
1 files changed, 10 insertions, 2 deletions
diff --git a/synapse/storage/event_federation.py b/synapse/storage/event_federation.py
index 26d570cf2d..91d19857b1 100644
--- a/synapse/storage/event_federation.py
+++ b/synapse/storage/event_federation.py
@@ -394,8 +394,16 @@ class EventFederationStore(SQLBaseStore):
                 (room_id, event_id, limit - len(event_results))
             )
 
-            for row in txn.fetchall():
-                queue.put((-row[0], row[1]))
+            depth = self._simple_select_one_onecol_txn(
+                txn,
+                table="events",
+                keyvalues={
+                    "event_id": event_id,
+                },
+                retcol="depth"
+            )
+
+            queue.put((-depth, event_id))
 
         while not queue.empty() and len(event_results) < limit:
             try: