Skip to content

Commit b34c0b1

Browse files
authored
fix: the Ceil method rounding calculations (#40)
Signed-off-by: Cabinfever_B <cabinfeveroier@gmail.com>
1 parent 99110a3 commit b34c0b1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ratelimit/bbr/bbr.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,7 @@ func (l *BBR) Allow() (ratelimit.DoneFunc, error) {
299299
ms := float64(time.Millisecond)
300300
return func(ratelimit.DoneInfo) {
301301
//nolint
302-
if rt := int64(math.Ceil(float64(time.Now().UnixNano()-start)) / ms); rt > 0 {
302+
if rt := int64(math.Ceil(float64(time.Now().UnixNano()-start) / ms)); rt > 0 {
303303
l.rtStat.Add(rt)
304304
}
305305
atomic.AddInt64(&l.inFlight, -1)

0 commit comments

Comments
 (0)