fix
This commit is contained in:
@@ -57,10 +57,7 @@ func (r *RateLimiter) Allow(ctx context.Context, key string, cfg RateLimitConfig
|
||||
}
|
||||
|
||||
count := int(incrCmd.Val())
|
||||
remaining := cfg.Max - count
|
||||
if remaining < 0 {
|
||||
remaining = 0
|
||||
}
|
||||
remaining := max(cfg.Max-count, 0)
|
||||
|
||||
if count > cfg.Max {
|
||||
if cfg.BlockFor > 0 {
|
||||
|
||||
Reference in New Issue
Block a user