aboutsummaryrefslogtreecommitdiff
path: root/federationapi/internal
diff options
context:
space:
mode:
authorTill <2353100+S7evinK@users.noreply.github.com>2023-11-09 08:43:27 +0100
committerGitHub <noreply@github.com>2023-11-09 08:43:27 +0100
commit7863a405a5f41acd2e40b40ec288eebe781eac1a (patch)
tree1d94d328f0981ca1b9c77d828c242f474e54147c /federationapi/internal
parent699f5ca8c1f73ff7e4b70f0f9273ffcb1c195cdc (diff)
Use `IsBlacklistedOrBackingOff` to determine if we should try to fetch devices (#3254)
Use `IsBlacklistedOrBackingOff` from the federation API to check if we should fetch devices. To reduce back pressure, we now only queue retrying servers if there's space in the channel.
Diffstat (limited to 'federationapi/internal')
-rw-r--r--federationapi/internal/api.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/federationapi/internal/api.go b/federationapi/internal/api.go
index 3e6f3956..67388a10 100644
--- a/federationapi/internal/api.go
+++ b/federationapi/internal/api.go
@@ -112,7 +112,7 @@ func NewFederationInternalAPI(
}
}
-func (a *FederationInternalAPI) isBlacklistedOrBackingOff(s spec.ServerName) (*statistics.ServerStatistics, error) {
+func (a *FederationInternalAPI) IsBlacklistedOrBackingOff(s spec.ServerName) (*statistics.ServerStatistics, error) {
stats := a.statistics.ForServer(s)
if stats.Blacklisted() {
return stats, &api.FederationClientError{
@@ -151,7 +151,7 @@ func failBlacklistableError(err error, stats *statistics.ServerStatistics) (unti
func (a *FederationInternalAPI) doRequestIfNotBackingOffOrBlacklisted(
s spec.ServerName, request func() (interface{}, error),
) (interface{}, error) {
- stats, err := a.isBlacklistedOrBackingOff(s)
+ stats, err := a.IsBlacklistedOrBackingOff(s)
if err != nil {
return nil, err
}