@@ -114,8 +114,7 @@ function createWorkerProcess(id, env) {
114
114
const workerEnv = { ...process . env , ...env , NODE_UNIQUE_ID : `${ id } ` } ;
115
115
const execArgv = [ ...cluster . settings . execArgv ] ;
116
116
const debugArgRegex = / - - i n s p e c t (?: - b r k | - p o r t ) ? | - - d e b u g - p o r t / ;
117
- const nodeOptions = process . env . NODE_OPTIONS ?
118
- process . env . NODE_OPTIONS : '' ;
117
+ const nodeOptions = process . env . NODE_OPTIONS || '' ;
119
118
120
119
if ( ArrayPrototypeSome ( execArgv ,
121
120
( arg ) => RegExpPrototypeTest ( debugArgRegex , arg ) ) ||
@@ -299,17 +298,17 @@ function queryServer(worker, message) {
299
298
address = message . address ;
300
299
}
301
300
302
- let constructor = RoundRobinHandle ;
303
301
// UDP is exempt from round-robin connection balancing for what should
304
302
// be obvious reasons: it's connectionless. There is nothing to send to
305
303
// the workers except raw datagrams and that's pointless.
306
304
if ( schedulingPolicy !== SCHED_RR ||
307
305
message . addressType === 'udp4' ||
308
306
message . addressType === 'udp6' ) {
309
- constructor = SharedHandle ;
307
+ handle = new SharedHandle ( key , address , message ) ;
308
+ } else {
309
+ handle = new RoundRobinHandle ( key , address , message ) ;
310
310
}
311
311
312
- handle = new constructor ( key , address , message ) ;
313
312
handles . set ( key , handle ) ;
314
313
}
315
314
0 commit comments