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

t.tinystruct.1.4.5.source-code.lock.lua Maven / Gradle / Ivy

Go to download

A simple framework for Java development. Simple is hard, Complex is easy. Better thinking, better design.

There is a newer version: 1.4.4
Show newest version
local key = KEYS[1]
local content = KEYS[2]
local ttl = ARGV[1]
local lock_set = redis.call('setnx', key, content)
if lock_set == 1 then
    redis.call('pexpire', key, ttl)
else
    local value = redis.call('get', key)
    if(value == content) then
        lock_set = 1; redis.call('pexpire', key, ttl)
    end
end
return lock_set;




© 2015 - 2025 Weber Informatics LLC | Privacy Policy