Commit 6d770926 authored by Oleg Iasinovskyi's avatar Oleg Iasinovskyi Committed by Nicolas Giard

fix: infinite loop on termination signal

parent d5157a3e
...@@ -266,9 +266,11 @@ bgAgent.on('message', m => { ...@@ -266,9 +266,11 @@ bgAgent.on('message', m => {
// ---------------------------------------- // ----------------------------------------
graceful.on('exit', () => { graceful.on('exit', () => {
global.winston.info('- SHUTTING DOWN - Terminating Background Agent...')
bgAgent.kill()
global.winston.info('- SHUTTING DOWN - Performing git sync...') global.winston.info('- SHUTTING DOWN - Performing git sync...')
return global.git.resync().then(() => { return global.git.resync().then(() => {
global.winston.info('- SHUTTING DOWN - Git sync successful. Now safe to exit.') global.winston.info('- SHUTTING DOWN - Git sync successful. Now safe to exit.')
process.kill(process.pid, 'SIGINT') process.exit()
}) })
}) })
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment