60 minutes grace period to make sure data is always fresh when TTL is almost about to be exceeded

This commit is contained in:
Reinhard Pointner 2016-03-23 23:39:12 +00:00
parent 08dd0d20ed
commit 8b86e69a8f
1 changed files with 3 additions and 3 deletions

View File

@ -12,15 +12,15 @@ public enum CacheType {
Weekly(Duration.ofDays(12), true),
Daily(Duration.ofDays(1), true),
Daily(Duration.ofHours(24), true),
Ephemeral(Duration.ofHours(2), false);
Ephemeral(Duration.ofHours(6), false);
final long timeToLiveSeconds;
final boolean diskPersistent;
CacheType(Duration timeToLive, boolean diskPersistent) {
this.timeToLiveSeconds = timeToLive.getSeconds();
this.timeToLiveSeconds = timeToLive.minusHours(1).getSeconds(); // 60 minutes grace period to make sure data is always fresh when TTL is almost about to be exceeded
this.diskPersistent = diskPersistent;
}