Allow cache.<name>.diskLimit = 0 to disable on disk cache
Being able to make the on disk cache disabled for only some caches is more useful than being able to make the on disk cache unlimited in size. Ehcache isn't that efficient at writing elements out to the disk, and since this is strictly a cache, it should always have a reasonable bound placed on its contents. Signed-off-by: Shawn O. Pearce <sop@google.com>
This commit is contained in:
@@ -159,8 +159,8 @@ public class CacheManagerProvider implements Provider<CacheManager> {
|
||||
int buffer = c.getDiskSpoolBufferSizeMB() * MB;
|
||||
buffer = config.getInt("cache", name, "diskbuffer", buffer) / MB;
|
||||
c.setDiskSpoolBufferSizeMB(Math.max(1, buffer));
|
||||
c.setOverflowToDisk(true);
|
||||
c.setDiskPersistent(true);
|
||||
c.setOverflowToDisk(c.getMaxElementsOnDisk() > 0);
|
||||
c.setDiskPersistent(c.getMaxElementsOnDisk() > 0);
|
||||
}
|
||||
return c;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user