mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-12-10 10:20:32 -05: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
|
|
@ -245,6 +245,8 @@ class FederationSender(AbstractFederationSender):
|
|||
self.store = hs.get_datastores().main
|
||||
self.state = hs.get_state_handler()
|
||||
|
||||
self._storage_controllers = hs.get_storage_controllers()
|
||||
|
||||
self.clock = hs.get_clock()
|
||||
self.is_mine_id = hs.is_mine_id
|
||||
|
||||
|
|
@ -602,7 +604,9 @@ class FederationSender(AbstractFederationSender):
|
|||
room_id = receipt.room_id
|
||||
|
||||
# Work out which remote servers should be poked and poke them.
|
||||
domains_set = await self.state.get_current_hosts_in_room(room_id)
|
||||
domains_set = await self._storage_controllers.state.get_current_hosts_in_room(
|
||||
room_id
|
||||
)
|
||||
domains = [
|
||||
d
|
||||
for d in domains_set
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue