aboutsummaryrefslogtreecommitdiff
path: root/federationapi
diff options
context:
space:
mode:
authorTill <2353100+S7evinK@users.noreply.github.com>2022-08-23 16:54:42 +0200
committerGitHub <noreply@github.com>2022-08-23 16:54:42 +0200
commit78e5d05efc95c959b380d6ee4230f75885a597ad (patch)
tree180f39fd099a21261e371dcbe5d9893ef67d5438 /federationapi
parent14fea600bbeeb745c1ff1fc1519e4db968c17f86 (diff)
Only set backOffStarted to false if until is not zero (#2669)
Diffstat (limited to 'federationapi')
-rw-r--r--federationapi/statistics/statistics.go7
1 files changed, 4 insertions, 3 deletions
diff --git a/federationapi/statistics/statistics.go b/federationapi/statistics/statistics.go
index 8bac99cb..b8e16a25 100644
--- a/federationapi/statistics/statistics.go
+++ b/federationapi/statistics/statistics.go
@@ -5,10 +5,11 @@ import (
"sync"
"time"
- "github.com/matrix-org/dendrite/federationapi/storage"
"github.com/matrix-org/gomatrixserverlib"
"github.com/sirupsen/logrus"
"go.uber.org/atomic"
+
+ "github.com/matrix-org/dendrite/federationapi/storage"
)
// Statistics contains information about all of the remote federated
@@ -126,13 +127,13 @@ func (s *ServerStatistics) Failure() (time.Time, bool) {
go func() {
until, ok := s.backoffUntil.Load().(time.Time)
- if ok {
+ if ok && !until.IsZero() {
select {
case <-time.After(time.Until(until)):
case <-s.interrupt:
}
+ s.backoffStarted.Store(false)
}
- s.backoffStarted.Store(false)
}()
}