mirror of
https://github.com/element-hq/synapse.git
synced 2024-11-24 02:25:45 +03:00
Don't be too enthusiatic with defer.gatherResults
This commit is contained in:
parent
b2c7bd4b09
commit
ffdb8c3828
1 changed files with 8 additions and 4 deletions
|
@ -405,8 +405,12 @@ class MessageHandler(BaseHandler):
|
|||
except:
|
||||
logger.exception("Failed to get snapshot")
|
||||
|
||||
# Only do N rooms at once
|
||||
n = 5
|
||||
d_list = [handle_room(e) for e in room_list]
|
||||
for ds in [d_list[i:i + n] for i in range(0, len(d_list), n)]:
|
||||
yield defer.gatherResults(
|
||||
[handle_room(e) for e in room_list],
|
||||
ds,
|
||||
consumeErrors=True
|
||||
).addErrback(unwrapFirstError)
|
||||
|
||||
|
|
Loading…
Reference in a new issue