浏览代码

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

* conditional overflow doesn't overflow on capacity

* typo
Manuel Sabban 2 年之前
父节点
当前提交
d6361d0a40
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      pkg/leakybucket/timemachine.go

+ 1 - 1
pkg/leakybucket/timemachine.go

@@ -35,7 +35,7 @@ func TimeMachinePour(l *Leaky, msg types.Event) {
 	}
 	l.Last_ts = d
 	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.Queue.Add(msg)
 	} else {