RedisTemplate redisTemplate;
Long seconds = redisTemplate.opsForValue().getOperations().getExpire("redisKey");//此方法返回单位为秒过期时长
// 当seconds==null时 会在事务或管道时

返回值为-1时 此键值没有设置过期日期

返回值为-2时 不存在此键

相关文章:

  • 2021-10-13
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 1970-01-01
  • 2022-02-08
  • 2022-12-23
猜你喜欢
  • 2022-02-01
  • 2022-12-23
  • 2022-12-23
  • 2021-11-20
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案