summary refs log tree commit diff
path: root/synapse/storage/databases/main/presence.py
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2020-09-23 16:11:18 +0100
committerGitHub <noreply@github.com>2020-09-23 16:11:18 +0100
commitcbabb312e0b59090e5a8cf9e7e016a8618e62867 (patch)
tree316a23381d88a731153f80a5dc9b82622ca96a95 /synapse/storage/databases/main/presence.py
parentDon't push if an user account has expired (#8353) (diff)
downloadsynapse-cbabb312e0b59090e5a8cf9e7e016a8618e62867.tar.xz
Use `async with` for ID gens (#8383)
This will allow us to hit the DB after we've finished using the generated stream ID.
Diffstat (limited to 'synapse/storage/databases/main/presence.py')
-rw-r--r--synapse/storage/databases/main/presence.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/synapse/storage/databases/main/presence.py b/synapse/storage/databases/main/presence.py
index c9f655dfb7..dbbb99cb95 100644
--- a/synapse/storage/databases/main/presence.py
+++ b/synapse/storage/databases/main/presence.py
@@ -23,11 +23,11 @@ from synapse.util.iterutils import batch_iter
 
 class PresenceStore(SQLBaseStore):
     async def update_presence(self, presence_states):
-        stream_ordering_manager = await self._presence_id_gen.get_next_mult(
+        stream_ordering_manager = self._presence_id_gen.get_next_mult(
             len(presence_states)
         )
 
-        with stream_ordering_manager as stream_orderings:
+        async with stream_ordering_manager as stream_orderings:
             await self.db_pool.runInteraction(
                 "update_presence",
                 self._update_presence_txn,