1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
--[[ Release lock Input: KEYS[1] 'lock', ARGV[1] token ARGV[2] lock duration in milliseconds Output: "OK" if lock extented succesfully. ]] local rcall = redis.call if rcall("GET", KEYS[1]) == ARGV[1] then return rcall("DEL", KEYS[1]) else return 0 end