forked from j62/ctbrec
Suppress exceptions, if the http cache cannot be deleted
This commit is contained in:
parent
de282d24a6
commit
d5f453a7a1
|
@ -441,12 +441,16 @@ public class CamrecApplication extends Application {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void clearHttpCache() throws IOException {
|
private void clearHttpCache() throws IOException {
|
||||||
File httpCacheDir = new File(config.getConfigDir(), "cache");
|
try {
|
||||||
LOG.debug("Deleting http cache {}", httpCacheDir);
|
File httpCacheDir = new File(config.getConfigDir(), "cache");
|
||||||
HttpClientCacheProvider.getCache(config).evictAll();
|
LOG.debug("Deleting http cache {}", httpCacheDir);
|
||||||
HttpClientCacheProvider.getCache(config).close();
|
HttpClientCacheProvider.getCache(config).evictAll();
|
||||||
IoUtils.deleteDirectory(httpCacheDir);
|
HttpClientCacheProvider.getCache(config).close();
|
||||||
LOG.debug("Cache has been deleted");
|
IoUtils.deleteDirectory(httpCacheDir);
|
||||||
|
LOG.debug("Cache has been deleted");
|
||||||
|
} catch (Exception e) {
|
||||||
|
LOG.info("The HTTP cache was not completely deleted: {}", e.getLocalizedMessage());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void registerAlertSystem() {
|
private void registerAlertSystem() {
|
||||||
|
|
Loading…
Reference in New Issue