* auto-shutdown ehcache (so it's only shut down if it has been initialized before)
This commit is contained in:
parent
c0828bb8a5
commit
e277ea2af3
@ -338,6 +338,10 @@ public class Main {
|
|||||||
* Shutdown ehcache properly, so that disk-persistent stores can actually be saved to disk
|
* Shutdown ehcache properly, so that disk-persistent stores can actually be saved to disk
|
||||||
*/
|
*/
|
||||||
private static void initializeCache() {
|
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
|
// prepare cache folder for this application instance
|
||||||
File cacheRoot = new File(getApplicationFolder(), "cache");
|
File cacheRoot = new File(getApplicationFolder(), "cache");
|
||||||
|
|
||||||
@ -360,7 +364,6 @@ public class Main {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
CacheManager.getInstance().shutdown();
|
|
||||||
try {
|
try {
|
||||||
lock.release();
|
lock.release();
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
Loading…
Reference in New Issue
Block a user