diff options
author | Patrick Cloke <clokep@users.noreply.github.com> | 2020-08-27 13:38:41 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-27 13:38:41 -0400 |
commit | 9b7ac03af3e7ceae7d1933db566ee407cfdef72d (patch) | |
tree | bd29b6da47cb08b846e05ce004f0e8d4008ed374 /synapse/storage/databases/main/stats.py | |
parent | simple_search_list_txn should return None, not 0. (#8187) (diff) | |
download | synapse-9b7ac03af3e7ceae7d1933db566ee407cfdef72d.tar.xz |
Convert calls of async database methods to async (#8166)
Diffstat (limited to 'synapse/storage/databases/main/stats.py')
-rw-r--r-- | synapse/storage/databases/main/stats.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/synapse/storage/databases/main/stats.py b/synapse/storage/databases/main/stats.py index 9fe97af56a..7af2608ca4 100644 --- a/synapse/storage/databases/main/stats.py +++ b/synapse/storage/databases/main/stats.py @@ -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, |