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

* auto-shutdown ehcache (so it's only shut down if it has been initialized before)

This commit is contained in:
Reinhard Pointner 2012-10-27 06:34:22 +00:00
parent c0828bb8a5
commit e277ea2af3

View File

@ -338,6 +338,10 @@ public class Main {
* Shutdown ehcache properly, so that disk-persistent stores can actually be saved to disk
*/
private static void initializeCache() {
// auto-shutdown ehcache
System.setProperty("net.sf.ehcache.enableShutdownHook", "true");
Logger.getLogger("net.sf.ehcache.CacheManager").setLevel(Level.OFF);
// prepare cache folder for this application instance
File cacheRoot = new File(getApplicationFolder(), "cache");
@ -360,7 +364,6 @@ public class Main {
@Override
public void run() {
CacheManager.getInstance().shutdown();
try {
lock.release();
} catch (Exception e) {