diff options
author | Erik Johnston <erik@matrix.org> | 2015-05-13 11:29:03 +0100 |
---|---|---|
committer | Erik Johnston <erik@matrix.org> | 2015-05-13 11:29:03 +0100 |
commit | 619a21812be7872832865372587e98ed9e690184 (patch) | |
tree | f5c44bdea75e8a3d9907c3b511e6f6a7a0f233b7 /synapse/storage | |
parent | Batch fetching of events for state groups (diff) | |
download | synapse-619a21812be7872832865372587e98ed9e690184.tar.xz |
defer.gatherResults loop
Diffstat (limited to 'synapse/storage')
-rw-r--r-- | synapse/storage/state.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/synapse/storage/state.py b/synapse/storage/state.py index c300c6e29c..2b5c2d999d 100644 --- a/synapse/storage/state.py +++ b/synapse/storage/state.py @@ -103,12 +103,18 @@ class StateStore(SQLBaseStore): for row in rows ] - for vals in states.values(): + @defer.inlineCallbacks + def c(vals): vals[:] = yield self.runInteraction( "_get_state_groups_ev", fetch_events, vals ) + yield defer.gatherResults( + [c(vals) for vals in states.values()], + consumeErrors=True, + ) + defer.returnValue(states) def _store_state_groups_txn(self, txn, event, context): |