Wait upto 3 seconds for the app to quit

Otherwise systemd will kill us and we get crash emails.

Fixes #483
This commit is contained in:
Girish Ramakrishnan
2015-09-09 16:57:41 -07:00
parent c88591489d
commit 8c7dfdcef2
+10 -2
View File
@@ -43,5 +43,13 @@ server.start(function (err) {
var NOOP_CALLBACK = function () { };
process.on('SIGINT', function () { server.stop(NOOP_CALLBACK); });
process.on('SIGTERM', function () { server.stop(NOOP_CALLBACK); });
process.on('SIGINT', function () {
server.stop(NOOP_CALLBACK);
setTimeout(process.exit.bind(process), 3000);
});
process.on('SIGTERM', function () {
server.stop(NOOP_CALLBACK);
setTimeout(process.exit.bind(process), 3000);
});