Fix ZRANGE arguments in get_items.lua

This commit is contained in:
Fedor Indutny 2022-05-19 12:14:02 -07:00 committed by GitHub
parent d31ddb72f3
commit 20902df122
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 1 deletions

View File

@ -8,4 +8,12 @@ if locked then
return {}
end
return redis.call("ZRANGE", queueKey, 0, limit, "WITHSCORES")
-- The range is inclusive
local min = 0
local max = limit - 1
if max < 0 then
return {}
end
return redis.call("ZRANGE", queueKey, min, max, "WITHSCORES")