redistempalate的超时设置时,一定要每次用set写入时,更新超时,默认是不会自动更新的。

例如:


int tempTime = this.redisTemplate.getExpire("max").intValue();
tempCount = this.redisTemplate.opsForValue().get("max")-1;
this.redisTemplate.opsForValue().set("max", tempCount);
this.redisTemplate.expire("max",tempTime,TimeUnit.SECONDS);

原文链接:https://blog.csdn.net/yuxin6866/article/details/52401590

相关文章:

  • 2021-09-30
  • 2022-02-24
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-06-07
  • 2021-12-23
猜你喜欢
  • 2022-01-01
  • 2021-09-03
  • 2022-12-23
  • 2021-11-04
  • 2022-12-23
  • 2022-01-10
  • 2021-09-14
相关资源
相似解决方案