fix: HitQuota should be returned instead of Allowed when limit is equal to 1. (#1581)
This commit is contained in:
@@ -14,8 +14,8 @@ local window = tonumber(ARGV[2])
|
||||
local current = redis.call("INCRBY", KEYS[1], 1)
|
||||
if current == 1 then
|
||||
redis.call("expire", KEYS[1], window)
|
||||
return 1
|
||||
elseif current < limit then
|
||||
end
|
||||
if current < limit then
|
||||
return 1
|
||||
elseif current == limit then
|
||||
return 2
|
||||
|
||||
Reference in New Issue
Block a user