java: adjust cache expiration policy for long running java processes

This commit is contained in:
Chris Lu 2021-10-09 05:38:15 -07:00
parent 17e08a16f4
commit 5ca0a551ac
2 changed files with 2 additions and 2 deletions

View File

@ -15,7 +15,7 @@ public class ChunkCache {
}
this.cache = CacheBuilder.newBuilder()
.maximumSize(maxEntries)
.expireAfterAccess(1, TimeUnit.HOURS)
.expireAfterWrite(1, TimeUnit.HOURS)
.build();
}

View File

@ -15,7 +15,7 @@ public class VolumeIdCache {
}
this.cache = CacheBuilder.newBuilder()
.maximumSize(maxEntries)
.expireAfterAccess(5, TimeUnit.MINUTES)
.expireAfterWrite(5, TimeUnit.MINUTES)
.build();
}