File tree Expand file tree Collapse file tree
apps/api/src/instrument-records Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import { cpus } from 'os' ;
2- import { dirname , join } from 'path' ;
3- import { fileURLToPath } from 'url' ;
2+ import { join } from 'path' ;
43import { Worker } from 'worker_threads' ;
54
6- const __dirname = dirname ( fileURLToPath ( import . meta. url ) ) ;
7-
85import { replacer , reviver } from '@douglasneuroinformatics/libjs' ;
96import { InjectModel } from '@douglasneuroinformatics/libnest' ;
107import type { Model } from '@douglasneuroinformatics/libnest' ;
@@ -164,7 +161,7 @@ export class InstrumentRecordsService {
164161
165162 const workerPromises = chunks . map ( ( chunk ) => {
166163 return new Promise < InstrumentRecordsExport > ( ( resolve , reject ) => {
167- const worker = new Worker ( join ( __dirname , 'export-worker.ts' ) ) ;
164+ const worker = new Worker ( join ( import . meta . dirname , 'export-worker.ts' ) ) ;
168165 worker . postMessage ( { data : availableInstrumentArray , type : 'INIT' } ) ;
169166
170167 worker . on ( 'message' , ( message : InitialMessage ) => {
You can’t perform that action at this time.
0 commit comments