mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-04 02:54:49 -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
|
@ -377,7 +377,7 @@ class DeviceWorkerStore(SQLBaseStore):
|
|||
THe new stream ID.
|
||||
"""
|
||||
|
||||
with await self._device_list_id_gen.get_next() as stream_id:
|
||||
async with self._device_list_id_gen.get_next() as stream_id:
|
||||
await self.db_pool.runInteraction(
|
||||
"add_user_sig_change_to_streams",
|
||||
self._add_user_signature_change_txn,
|
||||
|
@ -1093,7 +1093,7 @@ class DeviceStore(DeviceWorkerStore, DeviceBackgroundUpdateStore):
|
|||
if not device_ids:
|
||||
return
|
||||
|
||||
with await self._device_list_id_gen.get_next_mult(
|
||||
async with self._device_list_id_gen.get_next_mult(
|
||||
len(device_ids)
|
||||
) as stream_ids:
|
||||
await self.db_pool.runInteraction(
|
||||
|
@ -1108,7 +1108,7 @@ class DeviceStore(DeviceWorkerStore, DeviceBackgroundUpdateStore):
|
|||
return stream_ids[-1]
|
||||
|
||||
context = get_active_span_text_map()
|
||||
with await self._device_list_id_gen.get_next_mult(
|
||||
async with self._device_list_id_gen.get_next_mult(
|
||||
len(hosts) * len(device_ids)
|
||||
) as stream_ids:
|
||||
await self.db_pool.runInteraction(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue