mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2026-06-16 22:01:07 +00:00
Replace unload-on-timeout with timeout > 0
This commit is contained in:
+5
-9
@@ -16,23 +16,19 @@ public class ImageLibraryPackConfigTemplate implements ConfigTemplate, Propertie
|
|||||||
@Default
|
@Default
|
||||||
private boolean loadOnUse = false;
|
private boolean loadOnUse = false;
|
||||||
|
|
||||||
@Value("images.cache.unload-on-timeout")
|
|
||||||
@Description("If set to true, images will be removed from memory if not used after a timeout, otherwise images will stay loaded in memory. " +
|
|
||||||
"Trades decreased memory consumption when not performing any image reads for a period of time for extra processing time required to perform cache lookups.")
|
|
||||||
@Default
|
|
||||||
private boolean unloadOnTimeout = false;
|
|
||||||
|
|
||||||
@Value("images.cache.timeout")
|
@Value("images.cache.timeout")
|
||||||
@Description("How many seconds to keep images loaded in the image cache for if images.cache.unload-on-timeout is enabled.")
|
@Description("How many seconds to keep images loaded in the image cache for. " +
|
||||||
|
"If set to a number greater than 0, images will be removed from memory if not used after the timeout, otherwise images will stay loaded in memory. " +
|
||||||
|
"Setting the timeout to greater than 0 will trade decreased memory consumption when not performing any image reads for a period of time for extra processing time required to perform cache lookups.")
|
||||||
@Default
|
@Default
|
||||||
private int cacheTimeout = 300;
|
private int cacheTimeout = 0;
|
||||||
|
|
||||||
public boolean loadOnUse() {
|
public boolean loadOnUse() {
|
||||||
return loadOnUse;
|
return loadOnUse;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean unloadOnTimeout() {
|
public boolean unloadOnTimeout() {
|
||||||
return unloadOnTimeout;
|
return cacheTimeout > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getCacheTimeout() {
|
public int getCacheTimeout() {
|
||||||
|
|||||||
Reference in New Issue
Block a user