mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-05 07:25:05 -04:00
Fix performance regression in get_users_in_room
(#13972)
Fixes #13942. Introduced in #13575. Basically, let's only get the ordered set of hosts out of the DB if we need an ordered set of hosts. Since we split the function up the caching won't be as good, but I think it will still be fine as e.g. multiple backfill requests for the same room will hit the cache.
This commit is contained in:
parent
e8f30a76ca
commit
3dfc4a08dc
5 changed files with 97 additions and 69 deletions
|
@ -412,7 +412,9 @@ class FederationHandler:
|
|||
# First we try hosts that are already in the room.
|
||||
# TODO: HEURISTIC ALERT.
|
||||
likely_domains = (
|
||||
await self._storage_controllers.state.get_current_hosts_in_room(room_id)
|
||||
await self._storage_controllers.state.get_current_hosts_in_room_ordered(
|
||||
room_id
|
||||
)
|
||||
)
|
||||
|
||||
async def try_backfill(domains: Collection[str]) -> bool:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue