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 58
58
from synapse .util .caches .expiringcache import ExpiringCache
59
59
from synapse .util .cancellation import cancellable
60
60
from 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
+ )
62
65
63
66
if TYPE_CHECKING :
64
67
from synapse .server import HomeServer
@@ -1269,8 +1272,18 @@ async def _maybe_retry_device_resync(self) -> None:
1269
1272
self ._resync_retry_in_progress = True
1270
1273
# Get all of the users that need resyncing.
1271
1274
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
+
1272
1282
# Iterate over the set of user IDs.
1273
1283
for user_id in need_resync :
1284
+ if get_domain_from_id (user_id ) not in hosts :
1285
+ continue
1286
+
1274
1287
try :
1275
1288
# Try to resync the current user's devices list.
1276
1289
result = (await self .multi_user_device_resync ([user_id ], False ))[
You can’t perform that action at this time.
0 commit comments