conditional overflow doesn't overflow on capacity (#2412)

* conditional overflow doesn't overflow on capacity

* typo
This commit is contained in:
Manuel Sabban 2023-08-08 17:12:50 +02:00 committed by GitHub
parent cd9d8f309d
commit d6361d0a40
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -35,7 +35,7 @@ func TimeMachinePour(l *Leaky, msg types.Event) {
} }
l.Last_ts = d l.Last_ts = d
l.mutex.Unlock() l.mutex.Unlock()
if l.Limiter.AllowN(d, 1) { if l.Limiter.AllowN(d, 1) || l.conditionalOverflow {
l.logger.Tracef("Time-Pouring event %s (tokens:%f)", d, l.Limiter.GetTokensCount()) l.logger.Tracef("Time-Pouring event %s (tokens:%f)", d, l.Limiter.GetTokensCount())
l.Queue.Add(msg) l.Queue.Add(msg)
} else { } else {