redis / redis-rb

A Ruby client library for Redis
MIT License
3.97k stars 1.03k forks source link

Calling set with keepttl=true returns false #1203

Closed davkim closed 1 year ago

davkim commented 1 year ago

I am currently on redis gem version=4.2.0

I see that in the code the keepttl is supported, however calling cache.set(key, value, keepttl: true) returns false instead of OK. I tried for the same key and value pair calling without keepttl: true returns OK.

Any idea why this is failing?

byroot commented 1 year ago

First Redis 4.2.0 is way outdated.

But even then:

>> Redis::VERSION
=> "4.2.0"
>> Redis.new.set("foo", "bar", keepttl: true)
=> "OK"

So whatever is happening isn't a problem with the gem, perhaps you have something monkey patching it or something.