You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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。
what's wrong?
Expected Behavior
when some data changed in redis, I can use resty.redis to acquire the new data always
Steps To Reproduce
I execute set key1 value1 in redis-cli cmd,
In my lua script:
local result, err =red:get("key1"), the result is userdata: NULL when the red.get_reused_times() > 1, and the result is aaa when the red.get_reused_times() == 0.
How to get new data everytime in redis when the data is changed?
Anything else?
No response
The text was updated successfully, but these errors were encountered:
Is there an existing issue for this?
Kong version (
$ kong version
)Kong 3.4.0
Current Behavior
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。
what's wrong?
Expected Behavior
when some data changed in redis, I can use resty.redis to acquire the new data always
Steps To Reproduce
I execute set key1 value1 in redis-cli cmd,
In my lua script:
local result, err =red:get("key1"), the result is userdata: NULL when the red.get_reused_times() > 1, and the result is aaa when the red.get_reused_times() == 0.
How to get new data everytime in redis when the data is changed?
Anything else?
No response
The text was updated successfully, but these errors were encountered: