From 22e20b961e9186c6e6b68dfa3379f42f3192b811 Mon Sep 17 00:00:00 2001 From: barisusakli Date: Wed, 3 Dec 2014 17:10:25 -0500 Subject: [PATCH] pass all env variables to worker --- loader.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/loader.js b/loader.js index 812f8ba15e..cc6416b6f9 100644 --- a/loader.js +++ b/loader.js @@ -169,13 +169,13 @@ function forkWorker(index, isPrimary) { 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', [], { silent: silent, - env: { - isPrimary: isPrimary, - isCluster: true, - port: ports[index] - } + env: process.env }); worker.index = index;