diff options
author | Richard van der Hoff <1389908+richvdh@users.noreply.github.com> | 2018-04-30 00:34:28 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-04-30 00:34:28 +0100 |
commit | aab2e4da60a11de3d84e9a603077cc43386db1f4 (patch) | |
tree | f3b6b59408b7ca4cd16925ff7f1f50785032872b /synapse/storage/stream.py | |
parent | Merge pull request #3156 from NotAFile/py3-hmac-bytes (diff) | |
parent | pep8; remove spurious import (diff) | |
download | synapse-aab2e4da60a11de3d84e9a603077cc43386db1f4.tar.xz |
Merge pull request #3140 from matrix-org/rav/use_run_in_background
Use run_in_background in preference to preserve_fn
Diffstat (limited to 'synapse/storage/stream.py')
-rw-r--r-- | synapse/storage/stream.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/synapse/storage/stream.py b/synapse/storage/stream.py index 3b8b539993..4a5481ae53 100644 --- a/synapse/storage/stream.py +++ b/synapse/storage/stream.py @@ -41,7 +41,7 @@ from synapse.storage.events import EventsWorkerStore from synapse.util.caches.descriptors import cached from synapse.types import RoomStreamToken from synapse.util.caches.stream_change_cache import StreamChangeCache -from synapse.util.logcontext import make_deferred_yieldable, preserve_fn +from synapse.util.logcontext import make_deferred_yieldable, run_in_background from synapse.storage.engines import PostgresEngine, Sqlite3Engine import abc @@ -198,7 +198,8 @@ class StreamWorkerStore(EventsWorkerStore, SQLBaseStore): room_ids = list(room_ids) for rm_ids in (room_ids[i:i + 20] for i in xrange(0, len(room_ids), 20)): res = yield make_deferred_yieldable(defer.gatherResults([ - preserve_fn(self.get_room_events_stream_for_room)( + run_in_background( + self.get_room_events_stream_for_room, room_id, from_key, to_key, limit, order=order, ) for room_id in rm_ids |