mirror of
https://git.anonymousland.org/anonymousland/synapse-product.git
synced 2025-05-02 12:56:08 -04:00
Use async with
for ID gens (#8383)
This will allow us to hit the DB after we've finished using the generated stream ID.
This commit is contained in:
parent
916bb9d0d1
commit
cbabb312e0
15 changed files with 144 additions and 105 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue