From 9c3dcc995de56f2af116f8822eb5cd375f6efba6 Mon Sep 17 00:00:00 2001 From: tknew2 Date: Sat, 30 Aug 2014 19:33:06 +0200 Subject: [PATCH] force fork mode for node 0.10.x --- lib/CLI.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/lib/CLI.js b/lib/CLI.js index 69b9125b..4da67c49 100644 --- a/lib/CLI.js +++ b/lib/CLI.js @@ -108,9 +108,13 @@ CLI.start = function(script, opts, cb) { if (appConf['exec_mode'] == 'cluster_mode' && process.version.match(/0.10/) && - (parseInt(appConf.instances) == 1 || !appConf.instances)) { - //appConf['exec_mode'] = 'fork_mode'; - printOut('\x1B[31m[PM2] [WARNING] \x1B[39m you\'re using the 0.10.x node version, it\'s prefered that you switch to fork mode by adding the -x parameter. 0.11.x can use cluster_mode (default mode) efficiently.'); + !opts.force && + !process.env.TRAVIS) { + + appConf['exec_mode'] = 'fork_mode'; + appConf['instances'] = 1; + + printOut(chalk.red('\x1B[31m[PM2] As you use Node.JS 0.10.X your application is switched to fork_mode by default (adding -x option).\nIf you want to use clusters features, launch PM2 with Node.JS 0.11.13 or use -f to force.')); } // Script arguments