mirror of
https://git.anonymousland.org/anonymousland/synapse-product.git
synced 2024-12-24 18:09:23 -05:00
Don't completely drain the list
This commit is contained in:
parent
8763dd80ef
commit
70f272f71c
@ -505,8 +505,15 @@ class EventsStore(SQLBaseStore):
|
|||||||
while True:
|
while True:
|
||||||
try:
|
try:
|
||||||
with self._event_fetch_lock:
|
with self._event_fetch_lock:
|
||||||
event_list = self._event_fetch_list
|
tot = 0
|
||||||
self._event_fetch_list = []
|
for j, lst in enumerate(self._event_fetch_list):
|
||||||
|
if tot > 200:
|
||||||
|
break
|
||||||
|
tot += len(lst[0])
|
||||||
|
|
||||||
|
event_list = self._event_fetch_list[:j+1]
|
||||||
|
self._event_fetch_list = self._event_fetch_list[j+1:]
|
||||||
|
|
||||||
if not event_list:
|
if not event_list:
|
||||||
if self.database_engine.single_threaded or i > 3:
|
if self.database_engine.single_threaded or i > 3:
|
||||||
self._event_fetch_ongoing -= 1
|
self._event_fetch_ongoing -= 1
|
||||||
|
Loading…
Reference in New Issue
Block a user