mirror of
https://github.com/lingble/safe-redis-leader.git
synced 2025-10-29 11:42:34 +00:00
10 lines
171 B
Lua
10 lines
171 B
Lua
local key = KEYS[1]
|
|
local id = ARGV[1]
|
|
|
|
local current_id = redis.call('GET', key)
|
|
if (id == current_id) then
|
|
redis.call('DEL', key)
|
|
return true
|
|
else
|
|
return false
|
|
end |