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.
ocr/jyjz-common/jyjz-common-redis/target/classes/luascript/GetValueTimes.lua

27 lines
416 B

local key1 = KEYS[1]
local key2 = KEYS[2]
--返回的变量
local result = {}
local times = redis.call("get",key2)
local key1Value = redis.call("get",key1)
if not key1Value then
return
else
local is_exists = redis.call('EXISTS', KEYS[2]);
if(is_exists == 1) then
redis.call('EXPIRE',key1,times);
redis.call('EXPIRE',key2,times);
end
local result = {}
result[1] = key1Value
result[2] = times
return result
end