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
When managing redis sets using the redis client derived from Rails.cache.data, the keys associated with the created sets do not work properly for methods such as #exists#expire and #del
Example:
redis_store_client = Rails.cache.data
redis_store_client.sadd("set-test", "a")
redis_store_client.smembers("set-test")
#=> ["a"]
redis_store_client.exists("set-test")
#=> 0 (should be 1)
redis_store_client.expire("set-test", 1)
#=> false (should succeed and return true)
redis_store_client.del("set-test")
#=> 0 (should be 1)
redis_store_client.smembers("set-test")
#=> ["a"] (expire and del did not work)
# how it should work...
other_redis_client = Redis.new(host: ENV["REDIS_HOST"], port: ENV["REDIS_PORT"])
other_redis_client.sadd("set-test2", "a")
other_redis_client.smembers("set-test2")
#=> ["a"]
other_redis_client.exists("set-test2")
#=> 1
other_redis_client.expire("set-test2", 1)
#=> true
# wait 1 sec...
other_redis_client.smembers("set-test2")
#=> []
The text was updated successfully, but these errors were encountered:
Redis::Store inherits from the Redis client directly, and i don't believe we are overriding those methods, so i think this might be better suited for the redis-rb issue tracker.
When managing redis sets using the redis client derived from
Rails.cache.data
, the keys associated with the created sets do not work properly for methods such as#exists
#expire
and#del
Example:
The text was updated successfully, but these errors were encountered: