mirror of
https://github.com/mitb-archive/filebot
synced 2025-01-10 21:38:04 -05:00
* increase cache intervals
This commit is contained in:
parent
2bf9f96ea1
commit
5eb3e73120
@ -47,14 +47,14 @@
|
|||||||
/>
|
/>
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
Very long-lived cache (2 months) anime/series lists, movie index, etc
|
Very long-lived cache (4 months) anime/series lists, movie index, etc
|
||||||
-->
|
-->
|
||||||
<cache name="web-persistent-datasource"
|
<cache name="web-persistent-datasource"
|
||||||
maxElementsInMemory="50"
|
maxElementsInMemory="50"
|
||||||
maxElementsOnDisk="50000"
|
maxElementsOnDisk="50000"
|
||||||
eternal="false"
|
eternal="false"
|
||||||
timeToIdleSeconds="5259000"
|
timeToIdleSeconds="10512000"
|
||||||
timeToLiveSeconds="5259000"
|
timeToLiveSeconds="10512000"
|
||||||
overflowToDisk="true"
|
overflowToDisk="true"
|
||||||
diskPersistent="true"
|
diskPersistent="true"
|
||||||
memoryStoreEvictionPolicy="LRU"
|
memoryStoreEvictionPolicy="LRU"
|
||||||
|
@ -286,7 +286,7 @@ public class Main {
|
|||||||
* Show update notifications if updates are available
|
* Show update notifications if updates are available
|
||||||
*/
|
*/
|
||||||
private static void checkUpdate() throws Exception {
|
private static void checkUpdate() throws Exception {
|
||||||
final Properties updateProperties = new CachedResource<Properties>(getApplicationProperty("update.url"), Properties.class, 24 * 60 * 60 * 1000, 0, 0) {
|
final Properties updateProperties = new CachedResource<Properties>(getApplicationProperty("update.url"), Properties.class, CachedResource.ONE_DAY, 0, 0) {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Properties process(ByteBuffer data) {
|
public Properties process(ByteBuffer data) {
|
||||||
|
@ -228,7 +228,7 @@ public class ArgumentProcessor {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// fetch remote script only if modified
|
// fetch remote script only if modified
|
||||||
CachedResource<String> script = new CachedResource<String>(url, String.class, 24 * 60 * 60 * 1000) {
|
CachedResource<String> script = new CachedResource<String>(url, String.class, CachedResource.ONE_DAY) {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String process(ByteBuffer data) {
|
public String process(ByteBuffer data) {
|
||||||
|
@ -261,7 +261,7 @@ public class ReleaseInfo {
|
|||||||
protected static class PatternResource extends CachedResource<String[]> {
|
protected static class PatternResource extends CachedResource<String[]> {
|
||||||
|
|
||||||
public PatternResource(String resource) {
|
public PatternResource(String resource) {
|
||||||
super(resource, String[].class, 24 * 60 * 60 * 1000); // 24h update interval
|
super(resource, String[].class, ONE_WEEK); // 1 week update interval
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -273,7 +273,7 @@ public class ReleaseInfo {
|
|||||||
protected static class MovieResource extends CachedResource<Movie[]> {
|
protected static class MovieResource extends CachedResource<Movie[]> {
|
||||||
|
|
||||||
public MovieResource(String resource) {
|
public MovieResource(String resource) {
|
||||||
super(resource, Movie[].class, 7 * 24 * 60 * 60 * 1000); // check for updates once a week
|
super(resource, Movie[].class, ONE_MONTH); // check for updates every month
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -296,7 +296,7 @@ public class ReleaseInfo {
|
|||||||
protected static class TheTVDBIndexResource extends CachedResource<TheTVDBSearchResult[]> {
|
protected static class TheTVDBIndexResource extends CachedResource<TheTVDBSearchResult[]> {
|
||||||
|
|
||||||
public TheTVDBIndexResource(String resource) {
|
public TheTVDBIndexResource(String resource) {
|
||||||
super(resource, TheTVDBSearchResult[].class, 7 * 24 * 60 * 60 * 1000); // check for updates once a week
|
super(resource, TheTVDBSearchResult[].class, ONE_MONTH); // check for updates once a week
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -318,7 +318,7 @@ public class ReleaseInfo {
|
|||||||
protected static class AnidbIndexResource extends CachedResource<AnidbSearchResult[]> {
|
protected static class AnidbIndexResource extends CachedResource<AnidbSearchResult[]> {
|
||||||
|
|
||||||
public AnidbIndexResource(String resource) {
|
public AnidbIndexResource(String resource) {
|
||||||
super(resource, AnidbSearchResult[].class, 7 * 24 * 60 * 60 * 1000); // check for updates once a week
|
super(resource, AnidbSearchResult[].class, ONE_MONTH); // check for updates once a week
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -12,6 +12,10 @@ import net.sf.ehcache.Element;
|
|||||||
|
|
||||||
public abstract class AbstractCachedResource<R, T extends Serializable> {
|
public abstract class AbstractCachedResource<R, T extends Serializable> {
|
||||||
|
|
||||||
|
public static final long ONE_MONTH = 30 * 24 * 60 * 60 * 1000;
|
||||||
|
public static final long ONE_WEEK = 7 * 24 * 60 * 60 * 1000;
|
||||||
|
public static final long ONE_DAY = 24 * 60 * 60 * 1000;
|
||||||
|
|
||||||
private String resource;
|
private String resource;
|
||||||
private Class<T> type;
|
private Class<T> type;
|
||||||
private long expirationTime;
|
private long expirationTime;
|
||||||
|
@ -13,7 +13,7 @@ import net.sf.ehcache.CacheManager;
|
|||||||
public class CachedPage extends AbstractCachedResource<String, String> {
|
public class CachedPage extends AbstractCachedResource<String, String> {
|
||||||
|
|
||||||
public CachedPage(URL url) {
|
public CachedPage(URL url) {
|
||||||
super(url.toString(), String.class, 24 * 60 * 60 * 1000, 0, 0); // 24h update interval
|
super(url.toString(), String.class, ONE_DAY, 0, 0); // 24h update interval
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -14,7 +14,7 @@ import org.xml.sax.SAXException;
|
|||||||
public class CachedXmlResource extends AbstractCachedResource<String, String> {
|
public class CachedXmlResource extends AbstractCachedResource<String, String> {
|
||||||
|
|
||||||
public CachedXmlResource(String resource) {
|
public CachedXmlResource(String resource) {
|
||||||
super(resource, String.class, 24 * 60 * 60 * 1000, 2, 1000);
|
super(resource, String.class, ONE_WEEK, 2, 1000);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
Loading…
Reference in New Issue
Block a user