pass all env variables to worker

v1.18.x
barisusakli 10 years ago
parent d14cd254a5
commit 22e20b961e

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

Loading…
Cancel
Save