Remove HomeServer.get_datastore() (#12031)

The presence of this method was confusing, and mostly present for backwards
compatibility. Let's get rid of it.

Part of #11733
This commit is contained in:
Richard van der Hoff 2022-02-23 11:04:02 +00:00 committed by GitHub
parent c1ac2a8135
commit e24ff8ebe3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
230 changed files with 526 additions and 500 deletions

View file

@ -172,7 +172,9 @@ class ModuleApi:
# TODO: Fix this type hint once the types for the data stores have been ironed
# out.
self._store: Union[DataStore, "GenericWorkerSlavedStore"] = hs.get_datastore()
self._store: Union[
DataStore, "GenericWorkerSlavedStore"
] = hs.get_datastores().main
self._auth = hs.get_auth()
self._auth_handler = auth_handler
self._server_name = hs.hostname
@ -926,7 +928,7 @@ class ModuleApi:
)
# Try to retrieve the resulting event.
event = await self._hs.get_datastore().get_event(event_id)
event = await self._hs.get_datastores().main.get_event(event_id)
# update_membership is supposed to always return after the event has been
# successfully persisted.
@ -1270,7 +1272,7 @@ class PublicRoomListManager:
"""
def __init__(self, hs: "HomeServer"):
self._store = hs.get_datastore()
self._store = hs.get_datastores().main
async def room_is_in_public_room_list(self, room_id: str) -> bool:
"""Checks whether a room is in the public room list.