From 189dd45f7202e4891237fbab4162d4fbe2c0f5a5 Mon Sep 17 00:00:00 2001 From: jshkurti Date: Thu, 12 Mar 2015 17:57:49 +0100 Subject: [PATCH] Reinforced last commit purpose --- lib/CLI.js | 1 + lib/God.js | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/lib/CLI.js b/lib/CLI.js index 9abad97f..17c515f6 100644 --- a/lib/CLI.js +++ b/lib/CLI.js @@ -576,6 +576,7 @@ CLI.updatePM2 = function(cb) { printOut('Be sure to have the latest version by doing `npm install pm2@latest -g` before doing this procedure.'); // Dump PM2 processes + Satan.executeRemote('notifyKillPM2', {}, function() {}); CLI.dump(function(err) { debug('Dumping successfull', err); CLI.killDaemon(function() { diff --git a/lib/God.js b/lib/God.js index 2c14a5d0..a9b47fc5 100644 --- a/lib/God.js +++ b/lib/God.js @@ -344,6 +344,11 @@ God.handleExit = function handleExit(clu, exit_code) { God.notify('exit', proc); + if (God.pm2_being_killed) { + console.log('PM2 is being killed, stopping restart procedure...'); + return false; + } + if (!stopping) proc.pm2_env.restart_time += 1;