cluster by default is now opt-in

v1.18.x
psychobunny 11 years ago
parent 101ac701ef
commit e60d88afa6

@ -17,12 +17,6 @@ var nconf = require('nconf'),
} }
}; };
nconf.argv().file({
file: path.join(__dirname, '/config.json')
});
numCPUs = nconf.get('cluster') || require('os').cpus().length;
Loader.init = function() { Loader.init = function() {
cluster.setupMaster({ cluster.setupMaster({
exec: "app.js", exec: "app.js",
@ -157,6 +151,16 @@ Loader.reload = function() {
}); });
}; };
nconf.argv().file({
file: path.join(__dirname, '/config.json')
});
numCPUs = nconf.get('cluster') || 1;
numCPUs = (numCPUs === true) ? require('os').cpus().length : numCPUs;
if (nconf.get('daemon') !== false) { if (nconf.get('daemon') !== false) {
if (fs.existsSync(pidFilePath)) { if (fs.existsSync(pidFilePath)) {
try { try {

Loading…
Cancel
Save