Skip to content

Commit

Permalink
Share environment between worker and parent process (#4346)
Browse files Browse the repository at this point in the history
  • Loading branch information
vdiez authored Nov 1, 2023
1 parent 4e803a3 commit 6149763
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/bridge/src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import { errorMiddleware } from './errors';
import { debug, getContext } from '@sonar/shared/helpers';
import { timeoutMiddleware } from './timeout';
import { AddressInfo } from 'net';
import { Worker } from 'worker_threads';
import { Worker, SHARE_ENV } from 'worker_threads';
import {
registerGarbageCollectionObserver,
logMemoryConfiguration,
Expand Down Expand Up @@ -95,6 +95,7 @@ export function start(

worker = new Worker(path.resolve(__dirname, 'worker.js'), {
workerData: { context: getContext() },
env: SHARE_ENV,
});

worker.on('online', () => {
Expand Down

0 comments on commit 6149763

Please sign in to comment.