All Downloads are FREE. Search and download functionalities are using the official Maven repository.

lua.redis_set_with_expire.lua Maven / Gradle / Ivy

There is a newer version: 0.1.15
Show newest version
--redis_set_with_expire.lua
local expireTime = ARGV[1];
local argvIndex = 3;
for keyIndex = 1, #KEYS, 1 do
    local key = KEYS[keyIndex];
    local args = {};

    for _ = argvIndex, #ARGV, 1 do
        local arg = ARGV[argvIndex];
        argvIndex = argvIndex + 1;
        if (arg == "_placeholder_")
        then
            break;
        else
            table.insert(args, arg);
        end
    end

    redis.call("hmset", key, unpack(args));
    redis.call("expire", key, expireTime)
end




© 2015 - 2024 Weber Informatics LLC | Privacy Policy