Skip to content

Commit

Permalink
Merge pull request #5435 from watsonian/master
Browse files Browse the repository at this point in the history
Ensure increment_var value is a Number
  • Loading branch information
Unitech committed Sep 8, 2022
2 parents e35684e + 25d21ee commit 8ef8fd2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/God.js
Expand Up @@ -560,12 +560,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 8ef8fd2

Please sign in to comment.