mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-06 22:04:56 -04:00
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.
This commit is contained in:
parent
148fe58a24
commit
44de53bb79
9 changed files with 68 additions and 16 deletions
|
@ -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}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue