mirror of
https://github.com/Unitech/pm2.git
synced 2025-12-08 20:35:53 +00:00
add back edge case 0 memory restart and adapt tests
This commit is contained in:
parent
8ae67614f3
commit
c460ff76b6
@ -34,22 +34,22 @@ module.exports = function(God) {
|
||||
return cb();
|
||||
});
|
||||
}
|
||||
// else if (proc.pm2_env.status !== undefined &&
|
||||
// proc_key.monit.memory !== undefined &&
|
||||
// proc.pm2_env.status === cst.ONLINE_STATUS &&
|
||||
// proc_key.monit.memory === 0 &&
|
||||
// proc.pm2_env.exec_mode != 'fork_mode') {
|
||||
// console.log('[PM2][WORKER] Process %s restarted because it uses 0 memory and has ONLINE status',
|
||||
// proc.pm2_env.pm_id);
|
||||
// God.restartProcessId({
|
||||
// id: proc.pm2_env.pm_id,
|
||||
// env: proc.pm2_env.env
|
||||
// }, function(err, data) {
|
||||
// if (err)
|
||||
// console.error(err.stack || err);
|
||||
// return cb();
|
||||
// });
|
||||
// }
|
||||
else if (proc.pm2_env.status !== undefined &&
|
||||
proc_key.monit.memory !== undefined &&
|
||||
proc.pm2_env.status === cst.ONLINE_STATUS &&
|
||||
proc_key.monit.memory === 0 &&
|
||||
proc.pm2_env.exec_mode != 'fork_mode') {
|
||||
console.log('[PM2][WORKER] Process %s restarted because it uses 0 memory and has ONLINE status',
|
||||
proc.pm2_env.pm_id);
|
||||
God.restartProcessId({
|
||||
id: proc.pm2_env.pm_id,
|
||||
env: proc.pm2_env.env
|
||||
}, function(err, data) {
|
||||
if (err)
|
||||
console.error(err.stack || err);
|
||||
return cb();
|
||||
});
|
||||
}
|
||||
else {
|
||||
return cb();
|
||||
}
|
||||
|
||||
@ -6,7 +6,7 @@ cd $file_path
|
||||
|
||||
echo -e "\033[1mRunning tests for json files :\033[0m"
|
||||
|
||||
$pm2 start all.json
|
||||
PM2_WORKER_INTERVAL=90000 $pm2 start all.json
|
||||
should 'should start processes' 'online' 6
|
||||
|
||||
$pm2 stop all.json
|
||||
@ -51,7 +51,7 @@ $pm2 kill
|
||||
|
||||
########## JS style
|
||||
|
||||
$pm2 start configuration.json
|
||||
PM2_WORKER_INTERVAL=90000 $pm2 start configuration.json
|
||||
should 'should start processes' 'online' 6
|
||||
|
||||
$pm2 stop configuration.json
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user