mirror of
https://github.com/Unitech/pm2.git
synced 2026-02-01 16:57:09 +00:00
Watcher doesn't restart a process which is being stopped
This commit is contained in:
parent
91f46f5c6c
commit
438d81938b
@ -112,10 +112,12 @@ module.exports = function(God) {
|
||||
return cb(God.logAndGenerateError('Unknown process'), {});
|
||||
|
||||
async.eachLimit(processes, cst.CONCURRENT_ACTIONS, function(proc, next) {
|
||||
if (proc.pm2_env.status == cst.ONLINE_STATUS)
|
||||
if (proc.pm2_env.status === cst.ONLINE_STATUS)
|
||||
return God.restartProcessId({id:proc.pm2_env.pm_id}, next);
|
||||
else
|
||||
else if (proc.pm2_env.status !== cst.STOPPING_STATUS)
|
||||
return God.startProcessId(proc.pm2_env.pm_id, next);
|
||||
else
|
||||
return next();
|
||||
}, function(err) {
|
||||
if (err) return cb(God.logAndGenerateError(err));
|
||||
return cb(null, God.getFormatedProcesses());
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user