List of usage examples for org.springframework.data.redis.connection RedisConnection pTtl
@Nullable
Long pTtl(byte[] key);
From source file:com.zxy.commons.cache.RedisUtils.java
/** * Get the time to live for {@code key} in milliseconds. * <p>// ww w . ja v a2 s. c o m * See http://redis.io/commands/pttl * * @param key key * @return Long */ public static Long pTtl(byte[] key) { return redisTemplate.execute(new RedisCallback<Long>() { @Override public Long doInRedis(RedisConnection redis) throws DataAccessException { return redis.pTtl(key); } }); }
From source file:com.zxy.commons.cache.RedisHelper.java
/** * Get the time to live for {@code key} in milliseconds. * <p>//from w w w.j a v a 2 s. c o m * See http://redis.io/commands/pttl * * @param key key * @return Long */ public Long pTtl(byte[] key) { return redisTemplate.execute(new RedisCallback<Long>() { @Override public Long doInRedis(RedisConnection redis) throws DataAccessException { return redis.pTtl(key); } }); }