Explorar o código

fix: infinite loop on termination signal

Oleg Iasinovskyi %!s(int64=8) %!d(string=hai) anos
pai
achega
6d7709268f
Modificáronse 1 ficheiros con 3 adicións e 1 borrados
  1. 3 1
      server/index.js

+ 3 - 1
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()
   })
 })