protected void refreshTTL ( String key , CacheEntry ce ) { final String KEY = calcCacheKey ( key ) ; final long TTL = ce . getExpireAfterAccess ( ) ; try ( ShardedJedis jedis = getJedis ( ) ) { if ( TTL > 0 ) { if ( keyMode == KeyMode . HASH ) { jedis . expire ( getName ( ) , ( int ) TTL ) ; } else { jedis . expire ( SafeEncoder . encode ( KEY ) , ( int ) TTL ) ; } } } catch ( Exception e ) { throw e instanceof CacheException ? ( CacheException ) e : new CacheException ( e ) ; } }
Refresh TTL of a cache entry .