mirror of
https://github.com/Unitech/pm2.git
synced 2026-02-01 16:57:09 +00:00
fix the "restart_task" enumerable problem.
This commit is contained in:
parent
79de7657bc
commit
bb31516d81
@ -338,6 +338,8 @@ God.handleExit = function handleExit(clu, exit_code, kill_signal) {
|
||||
}
|
||||
|
||||
if (!stopping && !overlimit) {
|
||||
//make this property unenumerable
|
||||
Object.defineProperty(proc.pm2_env, 'restart_task', {configurable: true, writable: true});
|
||||
proc.pm2_env.restart_task = setTimeout(function() {
|
||||
proc.pm2_env.restart_time += 1;
|
||||
God.executeApp(proc.pm2_env);
|
||||
|
||||
@ -242,15 +242,13 @@ module.exports = function(God) {
|
||||
if (!(id in God.clusters_db))
|
||||
return cb(God.logAndGenerateError(id + ' : id unknown'), {});
|
||||
|
||||
var proc = God.clusters_db[id];
|
||||
|
||||
//clear time-out restart task
|
||||
clearTimeout(proc.pm2_env.restart_task);
|
||||
clearTimeout(God.clusters_db[id].pm2_env.restart_task);
|
||||
|
||||
if (proc.pm2_env.status == cst.STOPPED_STATUS)
|
||||
if (God.clusters_db[id].pm2_env.status == cst.STOPPED_STATUS)
|
||||
return cb(null, God.getFormatedProcess(id));
|
||||
// state == 'none' means that the process is not online yet
|
||||
if (proc.state && proc.state === 'none')
|
||||
if (God.clusters_db[id].state && God.clusters_db[id].state === 'none')
|
||||
return setTimeout(function() { God.stopProcessId(id, cb); }, 250);
|
||||
|
||||
var proc = God.clusters_db[id];
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user