From 619a21812be7872832865372587e98ed9e690184 Mon Sep 17 00:00:00 2001 From: Erik Johnston Date: Wed, 13 May 2015 11:29:03 +0100 Subject: [PATCH] defer.gatherResults loop --- synapse/storage/state.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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):