Skip to content

Commit 326e030

Browse files
committed
replace dirname logic with import.meta.dirname
1 parent a93fc5e commit 326e030

1 file changed

Lines changed: 2 additions & 5 deletions

File tree

apps/api/src/instrument-records/instrument-records.service.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
import { cpus } from 'os';
2-
import { dirname, join } from 'path';
3-
import { fileURLToPath } from 'url';
2+
import { join } from 'path';
43
import { Worker } from 'worker_threads';
54

6-
const __dirname = dirname(fileURLToPath(import.meta.url));
7-
85
import { replacer, reviver } from '@douglasneuroinformatics/libjs';
96
import { InjectModel } from '@douglasneuroinformatics/libnest';
107
import 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) => {

0 commit comments

Comments
 (0)