mirror of
https://github.com/matrix-org/dendrite.git
synced 2025-12-21 05:43:09 -06:00
Fix bug
This commit is contained in:
parent
ba243cf90f
commit
5788fa500e
|
|
@ -134,7 +134,7 @@ func (s *ServerStatistics) BackoffIfRequired(backingOff atomic.Bool, interrupt <
|
||||||
|
|
||||||
// Work out how long we should be backing off for.
|
// Work out how long we should be backing off for.
|
||||||
duration := time.Second * time.Duration(math.Exp2(float64(count)))
|
duration := time.Second * time.Duration(math.Exp2(float64(count)))
|
||||||
logrus.Debugf("Backing off %q for %s", s.serverName, duration)
|
logrus.Warnf("Backing off %q for %s", s.serverName, duration)
|
||||||
|
|
||||||
// Wait for either an interruption or for the backoff to
|
// Wait for either an interruption or for the backoff to
|
||||||
// complete.
|
// complete.
|
||||||
|
|
@ -144,10 +144,6 @@ func (s *ServerStatistics) BackoffIfRequired(backingOff atomic.Bool, interrupt <
|
||||||
case <-time.After(duration):
|
case <-time.After(duration):
|
||||||
}
|
}
|
||||||
|
|
||||||
// Drain the interrupt queue - helps with tests.
|
|
||||||
for range interrupt {
|
|
||||||
}
|
|
||||||
|
|
||||||
return duration
|
return duration
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue