1
0

Use 'get_domains_from_state' still for backfill

This commit is contained in:
Erik Johnston
2022-05-20 15:13:06 +01:00
parent 4bd06c9c98
commit 456a394bf7
+8 -4
View File
@@ -362,11 +362,15 @@ class FederationHandler:
# First we try hosts that are already in the room
# TODO: HEURISTIC ALERT.
users_in_room = await self.store.get_users_in_room(room_id)
likely_domains = {get_domain_from_id(u) for u in users_in_room}
likely_domains.discard(self.server_name)
curr_state = await self.store.get_current_state(room_id)
async def try_backfill(domains: Collection[str]) -> bool:
curr_domains = get_domains_from_state(curr_state)
likely_domains = [
domain for domain, depth in curr_domains if domain != self.server_name
]
async def try_backfill(domains: List[str]) -> bool:
# TODO: Should we try multiple of these at a time?
for dom in domains:
try: