fix cluster.fork

This commit is contained in:
Matteo Pagliazzi
2016-03-01 09:15:13 +01:00
parent 01b12cd8b4
commit 531d3969f4

View File

@@ -13,7 +13,9 @@ var cores = +nconf.get("WEB_CONCURRENCY") || 0;
if (cores!==0 && cluster.isMaster && (isDev || isProd)) {
// Fork workers. If config.json has CORES=x, use that - otherwise, use all cpus-1 (production)
_.times(cores, cluster.fork);
_.times(cores, function () {
cluster.fork();
});
cluster.on('disconnect', function(worker, code, signal) {
var w = cluster.fork(); // replace the dead worker