summary refs log tree commit diff
path: root/synapse/storage
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2015-05-21 15:37:43 +0100
committerErik Johnston <erik@matrix.org>2015-05-21 15:37:43 +0100
commit115ef3ddac9dbb1c49c31257190e77062b5a10a8 (patch)
tree559e95d4bb66174a5aa039bdb335da143d5fb3d3 /synapse/storage
parentMerge branch 'develop' of github.com:matrix-org/synapse into erikj/backfill_f... (diff)
downloadsynapse-115ef3ddac9dbb1c49c31257190e77062b5a10a8.tar.xz
Correctly capture Queue.Empty exception
Diffstat (limited to 'synapse/storage')
-rw-r--r--synapse/storage/event_federation.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/synapse/storage/event_federation.py b/synapse/storage/event_federation.py
index 80eff8e6f2..e171cbcdb4 100644
--- a/synapse/storage/event_federation.py
+++ b/synapse/storage/event_federation.py
@@ -19,7 +19,7 @@ from ._base import SQLBaseStore, cached
 from syutil.base64util import encode_base64
 
 import logging
-from Queue import PriorityQueue
+from Queue import PriorityQueue, Empty
 
 
 logger = logging.getLogger(__name__)
@@ -398,7 +398,10 @@ class EventFederationStore(SQLBaseStore):
                 queue.put(row)
 
         while not queue.empty() and len(event_results) < limit:
-            _, event_id = queue.get_nowait()
+            try:
+                _, event_id = queue.get_nowait()
+            except Empty:
+                break
 
             event_results.add(event_id)