diff options
author | Patrick Cloke <clokep@users.noreply.github.com> | 2020-08-04 07:21:47 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-04 07:21:47 -0400 |
commit | e19de43eb5903c3b6ccca82334971ebc57fc38de (patch) | |
tree | 5925175ac5a8c43303bc5e262fc9bd4f2d6e76f3 /synapse/storage | |
parent | re-implement daemonize (#8011) (diff) | |
download | synapse-e19de43eb5903c3b6ccca82334971ebc57fc38de.tar.xz |
Convert streams to async. (#8014)
Diffstat (limited to 'synapse/storage')
-rw-r--r-- | synapse/storage/data_stores/main/stream.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/synapse/storage/data_stores/main/stream.py b/synapse/storage/data_stores/main/stream.py index 10d39b3699..f1334a6efc 100644 --- a/synapse/storage/data_stores/main/stream.py +++ b/synapse/storage/data_stores/main/stream.py @@ -39,6 +39,7 @@ what sort order was used: import abc import logging from collections import namedtuple +from typing import Optional from twisted.internet import defer @@ -557,19 +558,18 @@ class StreamWorkerStore(EventsWorkerStore, SQLBaseStore): return self.db.runInteraction("get_room_event_before_stream_ordering", _f) - @defer.inlineCallbacks - def get_room_events_max_id(self, room_id=None): + async def get_room_events_max_id(self, room_id: Optional[str] = None) -> str: """Returns the current token for rooms stream. By default, it returns the current global stream token. Specifying a `room_id` causes it to return the current room specific topological token. """ - token = yield self.get_room_max_stream_ordering() + token = self.get_room_max_stream_ordering() if room_id is None: return "s%d" % (token,) else: - topo = yield self.db.runInteraction( + topo = await self.db.runInteraction( "_get_max_topological_txn", self._get_max_topological_txn, room_id ) return "t%d-%d" % (topo, token) |