mirror of
https://mau.dev/maunium/synapse.git
synced 2024-09-05 00:52:20 +00:00
Correctly capture Queue.Empty exception
This commit is contained in:
parent
4fb858d90a
commit
115ef3ddac
@ -19,7 +19,7 @@ from ._base import SQLBaseStore, cached
|
|||||||
from syutil.base64util import encode_base64
|
from syutil.base64util import encode_base64
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
from Queue import PriorityQueue
|
from Queue import PriorityQueue, Empty
|
||||||
|
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
@ -398,7 +398,10 @@ class EventFederationStore(SQLBaseStore):
|
|||||||
queue.put(row)
|
queue.put(row)
|
||||||
|
|
||||||
while not queue.empty() and len(event_results) < limit:
|
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)
|
event_results.add(event_id)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user