From ef63d816fe123ab6d5afce504d06adb9d3bc4316 Mon Sep 17 00:00:00 2001 From: Julian Lam Date: Fri, 21 Feb 2014 23:52:23 -0500 Subject: [PATCH] NodeBB will now listen to SIGINT signal --- src/webserver.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/webserver.js b/src/webserver.js index 01a779e972..0d65b7c99e 100644 --- a/src/webserver.js +++ b/src/webserver.js @@ -44,6 +44,16 @@ if(nconf.get('ssl')) { module.exports.server = server; +// Signals +process.on('SIGINT', function() { + winston.info('[app] Shutdown Initialised.'); + db.close(); + winston.info('[app] Database connection closed.'); + + winston.info('[app] Goodbye!'); + process.exit(); +}); + (function (app) { "use strict";