mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-06 04:54:57 -04:00
Convert additional databases to async/await (#8199)
This commit is contained in:
parent
5bf8e5f55b
commit
54f8d73c00
7 changed files with 147 additions and 137 deletions
|
@ -276,12 +276,14 @@ class ReceiptsWorkerStore(SQLBaseStore):
|
|||
}
|
||||
return results
|
||||
|
||||
def get_users_sent_receipts_between(self, last_id: int, current_id: int):
|
||||
async def get_users_sent_receipts_between(
|
||||
self, last_id: int, current_id: int
|
||||
) -> List[str]:
|
||||
"""Get all users who sent receipts between `last_id` exclusive and
|
||||
`current_id` inclusive.
|
||||
|
||||
Returns:
|
||||
Deferred[List[str]]
|
||||
The list of users.
|
||||
"""
|
||||
|
||||
if last_id == current_id:
|
||||
|
@ -296,7 +298,7 @@ class ReceiptsWorkerStore(SQLBaseStore):
|
|||
|
||||
return [r[0] for r in txn]
|
||||
|
||||
return self.db_pool.runInteraction(
|
||||
return await self.db_pool.runInteraction(
|
||||
"get_users_sent_receipts_between", _get_users_sent_receipts_between_txn
|
||||
)
|
||||
|
||||
|
@ -553,8 +555,10 @@ class ReceiptsStore(ReceiptsWorkerStore):
|
|||
|
||||
return stream_id, max_persisted_id
|
||||
|
||||
def insert_graph_receipt(self, room_id, receipt_type, user_id, event_ids, data):
|
||||
return self.db_pool.runInteraction(
|
||||
async def insert_graph_receipt(
|
||||
self, room_id, receipt_type, user_id, event_ids, data
|
||||
):
|
||||
return await self.db_pool.runInteraction(
|
||||
"insert_graph_receipt",
|
||||
self.insert_graph_receipt_txn,
|
||||
room_id,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue