diff options
author | Erik Johnston <erik@matrix.org> | 2019-10-29 15:08:22 +0000 |
---|---|---|
committer | Erik Johnston <erik@matrix.org> | 2019-10-29 15:08:22 +0000 |
commit | 2c35ffead257171d195f228bafd0d65b917e2165 (patch) | |
tree | f34e80db36883adfc9623079f72f847def223ae5 /synapse/storage/data_stores | |
parent | Make concurrently_execute work with async/await (diff) | |
download | synapse-2c35ffead257171d195f228bafd0d65b917e2165.tar.xz |
Port receipt and read markers to async/wait
Diffstat (limited to 'synapse/storage/data_stores')
-rw-r--r-- | synapse/storage/data_stores/main/events.py | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/synapse/storage/data_stores/main/events.py b/synapse/storage/data_stores/main/events.py index 03b5111c5d..067e77ae00 100644 --- a/synapse/storage/data_stores/main/events.py +++ b/synapse/storage/data_stores/main/events.py @@ -2439,12 +2439,11 @@ class EventsStore( logger.info("[purge] done") - @defer.inlineCallbacks - def is_event_after(self, event_id1, event_id2): + async def is_event_after(self, event_id1, event_id2): """Returns True if event_id1 is after event_id2 in the stream """ - to_1, so_1 = yield self._get_event_ordering(event_id1) - to_2, so_2 = yield self._get_event_ordering(event_id2) + to_1, so_1 = await self._get_event_ordering(event_id1) + to_2, so_2 = await self._get_event_ordering(event_id2) return (to_1, so_1) > (to_2, so_2) @cachedInlineCallbacks(max_entries=5000) |