From 6d7709268f87fdba0705b727ef3defd9cb46b09e Mon Sep 17 00:00:00 2001 From: Oleg Iasinovskyi Date: Thu, 20 Jul 2017 20:13:06 +0300 Subject: [PATCH] fix: infinite loop on termination signal --- server/index.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/server/index.js b/server/index.js index ab675695..07cc3df8 100644 --- a/server/index.js +++ b/server/index.js @@ -266,9 +266,11 @@ bgAgent.on('message', m => { // ---------------------------------------- graceful.on('exit', () => { + global.winston.info('- SHUTTING DOWN - Terminating Background Agent...') + bgAgent.kill() global.winston.info('- SHUTTING DOWN - Performing git sync...') return global.git.resync().then(() => { global.winston.info('- SHUTTING DOWN - Git sync successful. Now safe to exit.') - process.kill(process.pid, 'SIGINT') + process.exit() }) })