Try a synchronized shutdown when an uncaught exception occurs.

develop
Icedream 2015-10-16 08:21:55 +02:00
parent a0bded664a
commit 6ed562e279
1 changed files with 5 additions and 0 deletions

5
app.js
View File

@ -30,6 +30,11 @@ doShutdownAsync = function(cb) {
}); });
}; };
process.on("uncaughtException", function(err) {
log.fatal("Shutting down due to an uncaught exception!", err);
app.shutdownSync();
});
process.on("exit", function(e) { process.on("exit", function(e) {
log.debug("Triggered exit", e); log.debug("Triggered exit", e);
app.shutdownSync(); app.shutdownSync();