nanoctrl 0.0.5

NanoInfra control plane server
1
2
3
4
5
6
7
8
9
10
11
12
13
-- Generic heartbeat: refresh TTL for any key.
-- KEYS[1] = the Redis key (engine:{id} or agent:{name})
-- ARGV[1] = TTL in seconds

local key = KEYS[1]
local ttl = tonumber(ARGV[1])

if redis.call('EXISTS', key) == 0 then
    return 0
end

redis.call('EXPIRE', key, ttl)
return 1