mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-07 01:54:57 -04:00
Convert calls of async database methods to async (#8166)
This commit is contained in:
parent
c9fa696ea2
commit
9b7ac03af3
14 changed files with 114 additions and 84 deletions
|
@ -16,7 +16,7 @@
|
|||
|
||||
import logging
|
||||
from itertools import chain
|
||||
from typing import Tuple
|
||||
from typing import Any, Dict, Tuple
|
||||
|
||||
from twisted.internet.defer import DeferredLock
|
||||
|
||||
|
@ -222,11 +222,11 @@ class StatsStore(StateDeltasStore):
|
|||
desc="stats_incremental_position",
|
||||
)
|
||||
|
||||
def update_room_state(self, room_id, fields):
|
||||
async def update_room_state(self, room_id: str, fields: Dict[str, Any]) -> None:
|
||||
"""
|
||||
Args:
|
||||
room_id (str)
|
||||
fields (dict[str:Any])
|
||||
room_id
|
||||
fields
|
||||
"""
|
||||
|
||||
# For whatever reason some of the fields may contain null bytes, which
|
||||
|
@ -244,7 +244,7 @@ class StatsStore(StateDeltasStore):
|
|||
if field and "\0" in field:
|
||||
fields[col] = None
|
||||
|
||||
return self.db_pool.simple_upsert(
|
||||
await self.db_pool.simple_upsert(
|
||||
table="room_stats_state",
|
||||
keyvalues={"room_id": room_id},
|
||||
values=fields,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue