new flags --no-vizion and --no-autorestart

This commit is contained in:
jshkurti 2015-04-16 16:20:53 +02:00
parent 6df2fa175f
commit d4eb669e6d
3 changed files with 12 additions and 3 deletions

View File

@ -44,13 +44,16 @@ commander.version(pkg.version)
.option('--ignore-watch <folders|files>', 'folder/files to be ignored watching, chould be a specific name or regex - e.g. --ignore-watch="test node_modules \"some scripts\""')
.option('--node-args <node_args>', 'space delimited arguments to pass to node in cluster mode - e.g. --node-args="--debug=7001 --trace-deprecation"')
.option('--no-color', 'skip colors')
.option('--no-vizion', 'start an app without vizion feature (versioning control)')
.option('--no-autorestart', 'start an app without automatic restart')
.usage('[cmd] app');
commander.on('--help', function() {
console.log(' Basic Examples:');
console.log('');
console.log(' Start an app using all CPUs available + set a name :');
console.log(' $ pm2 start app.js -i max --name "api"');
console.log(' $ pm2 start app.js -i 0 --name "api"');
console.log('');
console.log(' Restart the previous app launched, by name :');
console.log(' $ pm2 restart api');

View File

@ -309,10 +309,10 @@ God.handleExit = function handleExit(clu, exit_code) {
return false;
}
if (!stopping)
if (!stopping && proc.pm2_env.autorestart)
proc.pm2_env.restart_time += 1;
if (!stopping && !overlimit)
if (!stopping && !overlimit && proc.pm2_env.autorestart)
this.executeApp(proc.pm2_env);
return false;

View File

@ -62,6 +62,12 @@
"merge_logs": {
"type": "boolean"
},
"vizion" : {
"type": "boolean"
},
"autorestart" : {
"type": "boolean"
},
"watch": {
"type": [
"boolean",