Use named variables instead of referring to KEYS/ARGV array indices in message cache scripts.

This commit is contained in:
Jon Chambers authored and Jon Chambers committed 2020-10-04 11:27:27 -04:00
1 parent f3f4bd33e5
commit 551a85c1e6
7 files changed
+75 -64

No files matched your search

+5 -4
View File
@@ -1,10 +1,11 @@
-- keys: queue_key, queue_locked_key
-- argv: limit
local queueKey = KEYS[1]
local queueLockKey = KEYS[2]
local limit = ARGV[1]
local locked = redis.call("GET", KEYS[2])
local locked = redis.call("GET", queueLockKey)
if locked then
return {}
end
return redis.call("ZRANGE", KEYS[1], 0, ARGV[1], "WITHSCORES")
return redis.call("ZRANGE", queueKey, 0, limit, "WITHSCORES")