Last active
August 29, 2015 13:57
-
-
Save mattsta/9508981 to your computer and use it in GitHub Desktop.
Sample "GETEX" Redis function returning GET values as multibulk instead of a simple string. Returns a Redis error on error or a 1.) Value when given a string key.
This file contains 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
local val,err = redis.pcall('get', KEYS[1]) | |
if err then | |
return err | |
else | |
return {val} | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment