diff options
author | Patrick Cloke <clokep@users.noreply.github.com> | 2020-08-28 09:37:55 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-28 09:37:55 -0400 |
commit | aec7085179464cc0a05177108ad2962d09ca4f4a (patch) | |
tree | accd3496816a54257d835982a95fe73995428987 /synapse/storage/databases/main/stream.py | |
parent | Ensure that the OpenID Connect remote ID is a string. (#8190) (diff) | |
download | synapse-aec7085179464cc0a05177108ad2962d09ca4f4a.tar.xz |
Convert state and stream stores and related code to async (#8194)
Diffstat (limited to 'synapse/storage/databases/main/stream.py')
-rw-r--r-- | synapse/storage/databases/main/stream.py | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/synapse/storage/databases/main/stream.py b/synapse/storage/databases/main/stream.py index 497f607703..24f44a7e36 100644 --- a/synapse/storage/databases/main/stream.py +++ b/synapse/storage/databases/main/stream.py @@ -539,7 +539,9 @@ class StreamWorkerStore(EventsWorkerStore, SQLBaseStore): return rows, token - def get_room_event_before_stream_ordering(self, room_id: str, stream_ordering: int): + async def get_room_event_before_stream_ordering( + self, room_id: str, stream_ordering: int + ) -> Tuple[int, int, str]: """Gets details of the first event in a room at or before a stream ordering Args: @@ -547,8 +549,7 @@ class StreamWorkerStore(EventsWorkerStore, SQLBaseStore): stream_ordering: Returns: - Deferred[(int, int, str)]: - (stream ordering, topological ordering, event_id) + A tuple of (stream ordering, topological ordering, event_id) """ def _f(txn): @@ -563,7 +564,9 @@ class StreamWorkerStore(EventsWorkerStore, SQLBaseStore): txn.execute(sql, (room_id, stream_ordering)) return txn.fetchone() - return self.db_pool.runInteraction("get_room_event_before_stream_ordering", _f) + return await self.db_pool.runInteraction( + "get_room_event_before_stream_ordering", _f + ) async def get_room_events_max_id(self, room_id: Optional[str] = None) -> str: """Returns the current token for rooms stream. |