force fork mode for node 0.10.x

This commit is contained in:
tknew2 2014-08-30 19:33:06 +02:00
parent 4a24746281
commit 9c3dcc995d

View File

@ -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