[英]How to update time-to-live of an entry using Redisson client in Java?
Let's say I'd like to store an object A
in Redis using RMapCacheReactive
and Redisson.假设我想使用RMapCacheReactive
和 Redisson 在 Redis 中存储一个 object A
In the beginning, I put it into the map with 10 000 ms TTL by the key B
.一开始,我通过密钥B
将其放入具有 10 000 ms TTL 的 map。 Right after that, I put the same object A
by the same key B
but with zero TTL.在那之后,我将相同的 object A
放在相同的密钥B
上,但 TTL 为零。
According to the documentation, the put method "stores value mapped by the key with a specified time to live" so my expectation was that A
would be stored in that map permanently.根据文档,put 方法“存储由具有指定生存时间的键映射的值”,因此我的期望是A
将永久存储在 map 中。
However, it was actually removed after that 10 000 ms passed (it became impossible to get it using Redisson client).然而,它实际上在 10 000 毫秒过去后被删除(使用 Redisson 客户端无法获取它)。 Is there a thing that I got wrong?有什么地方我弄错了吗?
I checked this behaviour on 3.13.4 and 3.12.5 versions of Redisson.我在 3.13.4 和 3.12.5 版本的 Redisson 上检查了这种行为。
I reported this issue on GitHub https://github.com/redisson/redisson/issues/3078 .我在 GitHub https://github.com/redisson/redisson/issues/3078上报告了这个问题。 Turned out that that was a bug that should be fixed in the next version (3.13.5).原来这是一个应该在下一个版本 (3.13.5) 中修复的错误。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.