summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/internal/cluster/primary.js9
1 files changed, 4 insertions, 5 deletions
diff --git a/lib/internal/cluster/primary.js b/lib/internal/cluster/primary.js
index e811341179..49011369ee 100644
--- a/lib/internal/cluster/primary.js
+++ b/lib/internal/cluster/primary.js
@@ -117,8 +117,7 @@ function createWorkerProcess(id, env) {
const workerEnv = { ...process.env, ...env, NODE_UNIQUE_ID: `${id}` };
const execArgv = [...cluster.settings.execArgv];
const debugArgRegex = /--inspect(?:-brk|-port)?|--debug-port/;
- const nodeOptions = process.env.NODE_OPTIONS ?
- process.env.NODE_OPTIONS : '';
+ const nodeOptions = process.env.NODE_OPTIONS || '';
if (ArrayPrototypeSome(execArgv,
(arg) => RegExpPrototypeTest(debugArgRegex, arg)) ||
@@ -302,17 +301,17 @@ function queryServer(worker, message) {
address = message.address;
}
- let constructor = RoundRobinHandle;
// UDP is exempt from round-robin connection balancing for what should
// be obvious reasons: it's connectionless. There is nothing to send to
// the workers except raw datagrams and that's pointless.
if (schedulingPolicy !== SCHED_RR ||
message.addressType === 'udp4' ||
message.addressType === 'udp6') {
- constructor = SharedHandle;
+ handle = new SharedHandle(key, address, message);
+ } else {
+ handle = new RoundRobinHandle(key, address, message);
}
- handle = new constructor(key, address, message);
handles.set(key, handle);
}