mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-03 19:24:51 -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
|
@ -339,7 +339,7 @@ class AccountDataStore(AccountDataWorkerStore):
|
|||
"""
|
||||
content_json = json_encoder.encode(content)
|
||||
|
||||
with await self._account_data_id_gen.get_next() as next_id:
|
||||
async with self._account_data_id_gen.get_next() as next_id:
|
||||
# no need to lock here as room_account_data has a unique constraint
|
||||
# on (user_id, room_id, account_data_type) so simple_upsert will
|
||||
# retry if there is a conflict.
|
||||
|
@ -387,7 +387,7 @@ class AccountDataStore(AccountDataWorkerStore):
|
|||
"""
|
||||
content_json = json_encoder.encode(content)
|
||||
|
||||
with await self._account_data_id_gen.get_next() as next_id:
|
||||
async with self._account_data_id_gen.get_next() as next_id:
|
||||
# no need to lock here as account_data has a unique constraint on
|
||||
# (user_id, account_data_type) so simple_upsert will retry if
|
||||
# there is a conflict.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue