You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
13 lines
213 B
13 lines
213 B
3 months ago
|
local key = KEYS[1]
|
||
|
local value = ARGV[1]
|
||
|
local expireTime = tonumber(ARGV[2])
|
||
|
|
||
|
local exists = redis.call("EXISTS", key)
|
||
|
|
||
|
if exists == 1 then
|
||
|
return 1
|
||
|
end
|
||
|
|
||
|
redis.call("SETEX", key, expireTime, value)
|
||
|
return 0
|