diff options
author | Patrick Cloke <clokep@users.noreply.github.com> | 2020-08-12 09:28:48 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-12 09:28:48 -0400 |
commit | a3a59bab7bb3b69dcfc5620e6f3ac51af3f0f965 (patch) | |
tree | eeec255478ccc92af2111519681831bca5aad289 /synapse/storage/databases/main/presence.py | |
parent | Fix typing for notifier (#8064) (diff) | |
download | synapse-a3a59bab7bb3b69dcfc5620e6f3ac51af3f0f965.tar.xz |
Convert appservice, group server, profile and more databases to async (#8066)
Diffstat (limited to 'synapse/storage/databases/main/presence.py')
-rw-r--r-- | synapse/storage/databases/main/presence.py | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/synapse/storage/databases/main/presence.py b/synapse/storage/databases/main/presence.py index 99e66dc6e9..59ba12820a 100644 --- a/synapse/storage/databases/main/presence.py +++ b/synapse/storage/databases/main/presence.py @@ -15,8 +15,6 @@ from typing import List, Tuple -from twisted.internet import defer - from synapse.storage._base import SQLBaseStore, make_in_list_sql_clause from synapse.storage.presence import UserPresenceState from synapse.util.caches.descriptors import cached, cachedList @@ -24,14 +22,13 @@ from synapse.util.iterutils import batch_iter class PresenceStore(SQLBaseStore): - @defer.inlineCallbacks - def update_presence(self, presence_states): + async def update_presence(self, presence_states): stream_ordering_manager = self._presence_id_gen.get_next_mult( len(presence_states) ) with stream_ordering_manager as stream_orderings: - yield self.db_pool.runInteraction( + await self.db_pool.runInteraction( "update_presence", self._update_presence_txn, stream_orderings, |