mirror of
https://git.anonymousland.org/anonymousland/synapse-product.git
synced 2025-05-06 10:15:02 -04:00
Convert simple_select_one and simple_select_one_onecol to async (#8162)
This commit is contained in:
parent
56efa9ec71
commit
4c6c56dc58
25 changed files with 220 additions and 113 deletions
|
@ -73,15 +73,15 @@ class RoomWorkerStore(SQLBaseStore):
|
|||
|
||||
self.config = hs.config
|
||||
|
||||
def get_room(self, room_id):
|
||||
async def get_room(self, room_id: str) -> dict:
|
||||
"""Retrieve a room.
|
||||
|
||||
Args:
|
||||
room_id (str): The ID of the room to retrieve.
|
||||
room_id: The ID of the room to retrieve.
|
||||
Returns:
|
||||
A dict containing the room information, or None if the room is unknown.
|
||||
"""
|
||||
return self.db_pool.simple_select_one(
|
||||
return await self.db_pool.simple_select_one(
|
||||
table="rooms",
|
||||
keyvalues={"room_id": room_id},
|
||||
retcols=("room_id", "is_public", "creator"),
|
||||
|
@ -330,8 +330,8 @@ class RoomWorkerStore(SQLBaseStore):
|
|||
return ret_val
|
||||
|
||||
@cached(max_entries=10000)
|
||||
def is_room_blocked(self, room_id):
|
||||
return self.db_pool.simple_select_one_onecol(
|
||||
async def is_room_blocked(self, room_id: str) -> Optional[bool]:
|
||||
return await self.db_pool.simple_select_one_onecol(
|
||||
table="blocked_rooms",
|
||||
keyvalues={"room_id": room_id},
|
||||
retcol="1",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue