mirror of
https://github.com/matrix-org/dendrite.git
synced 2026-01-21 04:53:14 -06:00
Use the same waitTime and status code range
This commit is contained in:
parent
4f24dac4dc
commit
c6799f1e2a
|
|
@ -408,7 +408,7 @@ userLoop:
|
||||||
} else if e.Blacklisted {
|
} else if e.Blacklisted {
|
||||||
waitTime = time.Hour * 8
|
waitTime = time.Hour * 8
|
||||||
break userLoop
|
break userLoop
|
||||||
} else if e.Code > 0 {
|
} else if e.Code >= 300 {
|
||||||
// We didn't get a real FederationClientError (e.g. in polylith mode, where gomatrix.HTTPError
|
// We didn't get a real FederationClientError (e.g. in polylith mode, where gomatrix.HTTPError
|
||||||
// are "converted" to FederationClientError), but we probably shouldn't hit them every $waitTime seconds.
|
// are "converted" to FederationClientError), but we probably shouldn't hit them every $waitTime seconds.
|
||||||
waitTime = time.Hour
|
waitTime = time.Hour
|
||||||
|
|
@ -426,7 +426,7 @@ userLoop:
|
||||||
// The remote server returned an error, give it some time to recover.
|
// The remote server returned an error, give it some time to recover.
|
||||||
// This is to avoid spamming remote servers, which may not be Matrix servers anymore.
|
// This is to avoid spamming remote servers, which may not be Matrix servers anymore.
|
||||||
if e.Code >= 300 {
|
if e.Code >= 300 {
|
||||||
waitTime = time.Minute * 10
|
waitTime = time.Hour
|
||||||
logrus.WithError(e).Error("GetUserDevices returned gomatrix.HTTPError")
|
logrus.WithError(e).Error("GetUserDevices returned gomatrix.HTTPError")
|
||||||
break userLoop
|
break userLoop
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue