File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
packages/node-runtime-worker-thread/src Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change 1515 */
1616import { once } from 'events' ;
1717import { SHARE_ENV , Worker } from 'worker_threads' ;
18+ import fs from 'fs' ;
1819import path from 'path' ;
1920import { exposeAll , createCaller } from './rpc' ;
2021import { InterruptHandle , interrupt as nativeInterrupt } from 'interruptor' ;
2122
2223const workerRuntimeSrcPath = path . resolve ( __dirname , 'worker-runtime.js' ) ;
2324
24- const workerProcess = new Worker ( workerRuntimeSrcPath , { env : SHARE_ENV } ) ;
25+ const workerProcess = new Worker (
26+ // It's fine in this use-case: this process is spawned so we are not blocking
27+ // anything in the main process
28+ // eslint-disable-next-line no-sync
29+ fs . readFileSync ( workerRuntimeSrcPath , 'utf8' ) ,
30+ { env : SHARE_ENV , eval : true }
31+ ) ;
2532
2633// We expect the amount of listeners to be more than the default value of 10 but
2734// probably not more than ~25 (all exposed methods on
You can’t perform that action at this time.
0 commit comments