mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-06 09:34:56 -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
|
@ -281,7 +281,7 @@ class PusherStore(PusherWorkerStore):
|
|||
last_stream_ordering,
|
||||
profile_tag="",
|
||||
) -> None:
|
||||
with await self._pushers_id_gen.get_next() as stream_id:
|
||||
async with self._pushers_id_gen.get_next() as stream_id:
|
||||
# no need to lock because `pushers` has a unique key on
|
||||
# (app_id, pushkey, user_name) so simple_upsert will retry
|
||||
await self.db_pool.simple_upsert(
|
||||
|
@ -344,7 +344,7 @@ class PusherStore(PusherWorkerStore):
|
|||
},
|
||||
)
|
||||
|
||||
with await self._pushers_id_gen.get_next() as stream_id:
|
||||
async with self._pushers_id_gen.get_next() as stream_id:
|
||||
await self.db_pool.runInteraction(
|
||||
"delete_pusher", delete_pusher_txn, stream_id
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue