lua-resty-redis
lua-resty-redis copied to clipboard
red:smembers("key"), sometime not include the new member?
trafficstars
in my kong lua scripts, I write some code in access function like this: local redis = require "resty.redis" local red = redis:new() red:set_timeouts(5000, 5000, 5000) local ok, err = red:connect(redisHost, redisPort) local result, err = red:smembers("all_allow_urls") local ok, keep_err = red:set_keepalive(10000, 100) at first, the key "all_allow_urls" in redis is a set, which include 10 members, then I execute SADD all_allow_urls 'aaa' in redis-cli cmd; but when I visit my kong to check the result from red:smembers("all_allow_urls"), it sometimes include "aaa" but sometimes not。 Can you help me?