-
-
Save anonymous/ac44fcf7ef0836c5b8e1 to your computer and use it in GitHub Desktop.
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 redis = require "resty.redis" | |
local redMaster = redis:new() | |
redMaster:set_timeout(1000) | |
redMaster:connect((hosts["RedisMaster"] or "127.0.0.1"), 6379) | |
ok, error = redMaster:multi() | |
if not ok then | |
ngx.log(ngx.ERR,"failed to run multi: ", err) | |
return false | |
end | |
redMaster:set(token,1) | |
redMaster:expire(token,60) | |
redMaster:exec() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment