mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-05 06:44:56 -04:00
Convert simple_update* and simple_select* to async (#8173)
This commit is contained in:
parent
a466b67972
commit
4a739c73b4
19 changed files with 164 additions and 133 deletions
|
@ -16,7 +16,7 @@
|
|||
|
||||
import abc
|
||||
import logging
|
||||
from typing import List, Optional, Tuple
|
||||
from typing import Any, Dict, List, Optional, Tuple
|
||||
|
||||
from twisted.internet import defer
|
||||
|
||||
|
@ -62,8 +62,10 @@ class ReceiptsWorkerStore(SQLBaseStore):
|
|||
return {r["user_id"] for r in receipts}
|
||||
|
||||
@cached(num_args=2)
|
||||
def get_receipts_for_room(self, room_id, receipt_type):
|
||||
return self.db_pool.simple_select_list(
|
||||
async def get_receipts_for_room(
|
||||
self, room_id: str, receipt_type: str
|
||||
) -> List[Dict[str, Any]]:
|
||||
return await self.db_pool.simple_select_list(
|
||||
table="receipts_linearized",
|
||||
keyvalues={"room_id": room_id, "receipt_type": receipt_type},
|
||||
retcols=("user_id", "event_id"),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue