1
0
mirror of https://github.com/mitb-archive/filebot synced 2024-12-24 08:48:51 -05:00

Cache OMDb resources for up to a month

This commit is contained in:
Reinhard Pointner 2017-02-27 22:08:52 +08:00
parent 9b7a6041cd
commit 1d91160521

View File

@ -125,7 +125,7 @@ public class OMDbClient implements MovieIdentificationService {
} }
public Object request(Map<String, Object> parameters) throws Exception { public Object request(Map<String, Object> parameters) throws Exception {
Cache cache = Cache.getCache(getName(), CacheType.Weekly); Cache cache = Cache.getCache(getName(), CacheType.Monthly);
String key = '?' + encodeParameters(parameters, true); String key = '?' + encodeParameters(parameters, true);
return cache.json(key, s -> getResource(s)).fetch(withPermit(fetchIfModified(), r -> REQUEST_LIMIT.acquirePermit())).expire(Cache.ONE_WEEK).get(); return cache.json(key, s -> getResource(s)).fetch(withPermit(fetchIfModified(), r -> REQUEST_LIMIT.acquirePermit())).expire(Cache.ONE_WEEK).get();