|
|
@ -169,13 +169,13 @@ function forkWorker(index, isPrimary) {
|
|
|
|
return console.log('[cluster] invalid port for worker : ' + index + ' ports: ' + ports.length);
|
|
|
|
return console.log('[cluster] invalid port for worker : ' + index + ' ports: ' + ports.length);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
process.env.isPrimary = isPrimary;
|
|
|
|
|
|
|
|
process.env.isCluster = true;
|
|
|
|
|
|
|
|
process.env.port = ports[index];
|
|
|
|
|
|
|
|
|
|
|
|
var worker = fork('app.js', [], {
|
|
|
|
var worker = fork('app.js', [], {
|
|
|
|
silent: silent,
|
|
|
|
silent: silent,
|
|
|
|
env: {
|
|
|
|
env: process.env
|
|
|
|
isPrimary: isPrimary,
|
|
|
|
|
|
|
|
isCluster: true,
|
|
|
|
|
|
|
|
port: ports[index]
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
worker.index = index;
|
|
|
|
worker.index = index;
|
|
|
|