mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-13 09:02:11 -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
|
@ -27,7 +27,7 @@ from synapse.api.room_versions import RoomVersion, RoomVersions
|
|||
from synapse.storage._base import SQLBaseStore, db_to_json
|
||||
from synapse.storage.database import DatabasePool, LoggingTransaction
|
||||
from synapse.storage.databases.main.search import SearchStore
|
||||
from synapse.types import ThirdPartyInstanceID
|
||||
from synapse.types import JsonDict, ThirdPartyInstanceID
|
||||
from synapse.util import json_encoder
|
||||
from synapse.util.caches.descriptors import cached
|
||||
|
||||
|
@ -1296,11 +1296,17 @@ class RoomStore(RoomBackgroundUpdateStore, RoomWorkerStore, SearchStore):
|
|||
|
||||
return self.db_pool.runInteraction("get_rooms", f)
|
||||
|
||||
def add_event_report(
|
||||
self, room_id, event_id, user_id, reason, content, received_ts
|
||||
):
|
||||
async def add_event_report(
|
||||
self,
|
||||
room_id: str,
|
||||
event_id: str,
|
||||
user_id: str,
|
||||
reason: str,
|
||||
content: JsonDict,
|
||||
received_ts: int,
|
||||
) -> None:
|
||||
next_id = self._event_reports_id_gen.get_next()
|
||||
return self.db_pool.simple_insert(
|
||||
await self.db_pool.simple_insert(
|
||||
table="event_reports",
|
||||
values={
|
||||
"id": next_id,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue