Graceful UI shutdown

This commit is contained in:
Kristinn Sigurdsson
2021-06-18 10:56:20 +00:00
parent a34e40a9f8
commit 37913cbb2e
@@ -180,9 +180,17 @@ public class EngineResource extends BaseResource {
cancel = true;
}
}
if(!cancel) {
System.exit(0);
}
if (!cancel) {
Flash.addFlash(getResponse(), "Shutting down ... bye");
new Thread(() -> {
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
}
System.exit(0);
}).start();
}
} else if ("gc".equals(action)) {
System.gc();
}