mirror of
https://github.com/signalapp/Signal-Server.git
synced 2026-12-01 15:36:47 +00:00
Use named variables instead of referring to KEYS/ARGV array indices in message cache scripts.
This commit is contained in:
1 parent
f3f4bd33e5
commit
551a85c1e6
7 files changed
+75
-64
No files matched your search
@@ -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")
|
||||
Reference in new issue
Block a user