diff options
author | Patrick Cloke <clokep@users.noreply.github.com> | 2020-09-01 09:21:48 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-01 09:21:48 -0400 |
commit | 54f8d73c005cf0401d05fc90e857da253f9d1168 (patch) | |
tree | 438e00a60e97c57d150d42c8d884d5ef0fe0f1da /synapse/storage/databases/main/receipts.py | |
parent | Convert the well known resolver to async (#8214) (diff) | |
download | synapse-54f8d73c005cf0401d05fc90e857da253f9d1168.tar.xz |
Convert additional databases to async/await (#8199)
Diffstat (limited to 'synapse/storage/databases/main/receipts.py')
-rw-r--r-- | synapse/storage/databases/main/receipts.py | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/synapse/storage/databases/main/receipts.py b/synapse/storage/databases/main/receipts.py index 436f22ad2d..4a0d5a320e 100644 --- a/synapse/storage/databases/main/receipts.py +++ b/synapse/storage/databases/main/receipts.py @@ -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, |