aboutsummaryrefslogtreecommitdiff
path: root/keyserver
diff options
context:
space:
mode:
authorKegsay <kegan@matrix.org>2020-08-26 15:38:21 +0100
committerGitHub <noreply@github.com>2020-08-26 15:38:21 +0100
commit29d64818420740d3a0cf8e9b39656eafa3109492 (patch)
treeec4ef74501ab826384b62a4f3c06cdc43c4155bb /keyserver
parentabd16ff4a0fe6e67fdddf31edd61d1ced797c7b8 (diff)
Wait for 8h between device list updates for blacklisted servers (#1344)
Diffstat (limited to 'keyserver')
-rw-r--r--keyserver/internal/device_list_update.go8
1 files changed, 6 insertions, 2 deletions
diff --git a/keyserver/internal/device_list_update.go b/keyserver/internal/device_list_update.go
index 3fbf31f1..4d1b1107 100644
--- a/keyserver/internal/device_list_update.go
+++ b/keyserver/internal/device_list_update.go
@@ -341,8 +341,12 @@ func (u *DeviceListUpdater) processServer(serverName gomatrixserverlib.ServerNam
if err != nil {
logger.WithError(err).WithField("user_id", userID).Error("failed to query device keys for user")
fcerr, ok := err.(*fedsenderapi.FederationClientError)
- if ok && fcerr.RetryAfter > 0 {
- waitTime = fcerr.RetryAfter
+ if ok {
+ if fcerr.RetryAfter > 0 {
+ waitTime = fcerr.RetryAfter
+ } else if fcerr.Blacklisted {
+ waitTime = time.Hour * 8
+ }
}
hasFailures = true
continue