This repository was archived by the owner on Apr 26, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +15
-1
lines changed
Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Original file line number Diff line number Diff line change 1+ Don't try refetching device lists for users on remote hosts that are marked as "down".
Original file line number Diff line number Diff line change 5858from synapse .util .caches .expiringcache import ExpiringCache
5959from synapse .util .cancellation import cancellable
6060from synapse .util .metrics import measure_func
61- from synapse .util .retryutils import NotRetryingDestination
61+ from synapse .util .retryutils import (
62+ NotRetryingDestination ,
63+ filter_destinations_by_retry_limiter ,
64+ )
6265
6366if TYPE_CHECKING :
6467 from synapse .server import HomeServer
@@ -1269,8 +1272,18 @@ async def _maybe_retry_device_resync(self) -> None:
12691272 self ._resync_retry_in_progress = True
12701273 # Get all of the users that need resyncing.
12711274 need_resync = await self .store .get_user_ids_requiring_device_list_resync ()
1275+
1276+ # Filter out users whose host is marked as "down" up front.
1277+ hosts = await filter_destinations_by_retry_limiter (
1278+ {get_domain_from_id (u ) for u in need_resync }, self .clock , self .store
1279+ )
1280+ hosts = set (hosts )
1281+
12721282 # Iterate over the set of user IDs.
12731283 for user_id in need_resync :
1284+ if get_domain_from_id (user_id ) not in hosts :
1285+ continue
1286+
12741287 try :
12751288 # Try to resync the current user's devices list.
12761289 result = (await self .multi_user_device_resync ([user_id ], False ))[
You can’t perform that action at this time.
0 commit comments