Skip to content

Commit

Permalink
chore(NA): fix usage from target for kbn optimizer
Browse files Browse the repository at this point in the history
  • Loading branch information
mistic committed Mar 30, 2021
1 parent 9419249 commit fad2630
Showing 1 changed file with 19 additions and 14 deletions.
33 changes: 19 additions & 14 deletions packages/kbn-optimizer/src/optimizer/observe_worker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,20 +62,25 @@ function usingWorkerProc<T>(
return Rx.using(
(): ProcResource => {
const workerPath = require.resolve('../worker/run_worker');
const workerFromSourcePath = require.resolve('../worker/run_worker_from_source');
const proc = execa.node(workerPath.endsWith('.ts') ? workerFromSourcePath : workerPath, [], {
nodeOptions: [
'--preserve-symlinks',
'--preserve-symlinks-main',
...(inspectFlag && config.inspectWorkers
? [`${inspectFlag}=${inspectPortCounter++}`]
: []),
...(config.maxWorkerCount <= 3 ? ['--max-old-space-size=2048'] : []),
],
buffer: false,
stderr: 'pipe',
stdout: 'pipe',
});
const proc = execa.node(
workerPath.endsWith('.ts')
? require.resolve('../worker/run_worker_from_source') // workerFromSourcePath
: workerPath,
[],
{
nodeOptions: [
'--preserve-symlinks',
'--preserve-symlinks-main',
...(inspectFlag && config.inspectWorkers
? [`${inspectFlag}=${inspectPortCounter++}`]
: []),
...(config.maxWorkerCount <= 3 ? ['--max-old-space-size=2048'] : []),
],
buffer: false,
stderr: 'pipe',
stdout: 'pipe',
}
);

return {
proc,
Expand Down

0 comments on commit fad2630

Please sign in to comment.