Created
August 5, 2015 21:29
-
-
Save itamarhaber/217968c5d54066df4743 to your computer and use it in GitHub Desktop.
Redis absolute TTL (accuracy +/- 1 second)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Returns a key's absolute TTL | |
local t = tonumber(redis.call('TTL', KEYS[1])) | |
if t > 0 then | |
t = t + tonumber(redis.call('TIME')[1]) | |
end | |
return t |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment