Skip to content

Commit

Permalink
Merge branch 'development' of github.com:Unitech/pm2 into development
Browse files Browse the repository at this point in the history
  • Loading branch information
Unitech committed Sep 12, 2022
2 parents 5e4dcbf + b3b2ca7 commit fa16e17
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions lib/God.js
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,6 @@ God.executeApp = function executeApp(env, cb) {

clu.once('error', function(err) {
console.error(err.stack || err);
clu.pm2_env.status = cst.ERRORED_STATUS;
try {
clu.destroy && clu.destroy();
}
Expand Down Expand Up @@ -302,7 +301,6 @@ God.executeApp = function executeApp(env, cb) {

clu.once('error', function cluError(err) {
console.error(err.stack || err);
clu.pm2_env.status = cst.ERRORED_STATUS;
try {
clu.kill && clu.kill();
}
Expand Down Expand Up @@ -560,12 +558,12 @@ God.injectVariables = function injectVariables (env, cb) {
return proc.pm2_env.name === env.name &&
typeof proc.pm2_env[env.increment_var] !== 'undefined';
}).map(function (proc) {
return proc.pm2_env[env.increment_var];
return Number(proc.pm2_env[env.increment_var]);
}).sort(function (a, b) {
return b - a;
})[0];
// inject a incremental variable
var defaut = env.env[env.increment_var] || 0;
var defaut = Number(env.env[env.increment_var]) || 0;
env[env.increment_var] = typeof lastIncrement === 'undefined' ? defaut : lastIncrement + 1;
env.env[env.increment_var] = env[env.increment_var];
}
Expand Down

0 comments on commit fa16e17

Please sign in to comment.