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

script.getLock.lua Maven / Gradle / Ivy

There is a newer version: 2.0.0
Show newest version
if ARGV[1] == 'true' then
    if redis.call('get', KEYS[1]) == ARGV[2] then
        return redis.call('set', KEYS[1], ARGV[2], 'EX', ARGV[3], 'XX')
    else
        return redis.call('set', KEYS[1], ARGV[2], 'EX', ARGV[3], 'NX')
    end
else
    return redis.call('set', KEYS[1], ARGV[2], 'EX', ARGV[3], 'NX')
end




© 2015 - 2024 Weber Informatics LLC | Privacy Policy