From 82c19a2196770c463d8c94fc9e5842dfe8697c8d Mon Sep 17 00:00:00 2001 From: icedream Date: Thu, 29 Oct 2015 03:08:44 +0100 Subject: [PATCH] Added explicit process.exit after app shutdown. Since introducing WebChimera.js the bot is no longer shutting down by itself after all services are shut down since the instances that WebChimera.js generates would still be alive after deletion. There is no way to get around this except if WebChimera.js reveals an explicit release function which it doesn't. The only release function gets called before the VM gets killed. --- app.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app.js b/app.js index 325d330..ec938f7 100644 --- a/app.js +++ b/app.js @@ -33,6 +33,7 @@ doShutdownAsync = function(cb) { process.on("uncaughtException", function(err) { log.error("Shutting down due to an uncaught exception!", err); app.shutdownSync(); + process.exit(0xFF); }); process.on("exit", function(e) { @@ -43,24 +44,29 @@ process.on("exit", function(e) { process.on("SIGTERM", function(e) { log.debug("Caught SIGTERM signal"); app.shutdown(); + process.exit(0); }); process.on("SIGINT", function() { log.debug("Caught SIGINT signal"); app.shutdown(); + process.exit(0); }); process.on("SIGHUP", function() { log.debug("Caught SIGHUP signal"); app.shutdown(); + process.exit(0); }); process.on("SIGQUIT", function() { log.debug("Caught SIGQUIT signal"); app.shutdown(); + process.exit(0); }); process.on("SIGABRT", function() { log.debug("Caught SIGABRT signal"); app.shutdown(); + process.exit(0); });