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

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")