diff --git a/bin/pm2 b/bin/pm2 index ea3ba1df..5f50f770 100755 --- a/bin/pm2 +++ b/bin/pm2 @@ -44,13 +44,16 @@ commander.version(pkg.version) .option('--ignore-watch ', '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 ', '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'); diff --git a/lib/God.js b/lib/God.js index 148ad984..6a8b493c 100644 --- a/lib/God.js +++ b/lib/God.js @@ -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; diff --git a/lib/schema.json b/lib/schema.json index cdd8d2de..36785473 100644 --- a/lib/schema.json +++ b/lib/schema.json @@ -62,6 +62,12 @@ "merge_logs": { "type": "boolean" }, + "vizion" : { + "type": "boolean" + }, + "autorestart" : { + "type": "boolean" + }, "watch": { "type": [ "boolean",