summary refs log tree commit diff
path: root/tests/handlers
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2022-06-06 18:46:11 +0300
committerGitHub <noreply@github.com>2022-06-06 16:46:11 +0100
commit44de53bb79f961147386ea2a8bfbeb54b007cd41 (patch)
tree69b9b7896e2f69518bebcdd579619099888be9b4 /tests/handlers
parentDo not break URL previews if an image is unreachable. (#12950) (diff)
downloadsynapse-44de53bb79f961147386ea2a8bfbeb54b007cd41.tar.xz
Reduce state pulled from DB due to sending typing and receipts over federation (#12964)
Reducing the amount of state we pull from the DB is useful as fetching state is expensive in terms of DB, CPU and memory.
Diffstat (limited to 'tests/handlers')
-rw-r--r--tests/handlers/test_typing.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/tests/handlers/test_typing.py b/tests/handlers/test_typing.py
index 14a0ee4922..7af1333126 100644
--- a/tests/handlers/test_typing.py
+++ b/tests/handlers/test_typing.py
@@ -129,10 +129,12 @@ class TypingNotificationsTestCase(unittest.HomeserverTestCase):
 
         hs.get_event_auth_handler().check_host_in_room = check_host_in_room
 
-        def get_joined_hosts_for_room(room_id: str):
+        async def get_current_hosts_in_room(room_id: str):
             return {member.domain for member in self.room_members}
 
-        self.datastore.get_joined_hosts_for_room = get_joined_hosts_for_room
+        hs.get_storage_controllers().state.get_current_hosts_in_room = (
+            get_current_hosts_in_room
+        )
 
         async def get_users_in_room(room_id: str):
             return {str(u) for u in self.room_members}