fix: HitQuota should be returned instead of Allowed when limit is equal to 1. (#1581)

This commit is contained in:
qi
2022-03-04 16:14:45 +08:00
committed by GitHub
parent 0c35f39a7d
commit 96c128c58a
2 changed files with 12 additions and 2 deletions

View File

@@ -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