X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Fworker%2FWorkerFactory.ts;h=01adb96e795eb1e93e74e94b5d8b9bb4c56f9489;hb=12b34061fc1777aae4fea0016899e74e6c3c5e70;hp=b297f42b231715643ef14761ca1c45a93295a5cf;hpb=35639ced7a1a8e9cfb7b0db675fc2757ea902d04;p=e-mobility-charging-stations-simulator.git diff --git a/src/worker/WorkerFactory.ts b/src/worker/WorkerFactory.ts index b297f42b..01adb96e 100644 --- a/src/worker/WorkerFactory.ts +++ b/src/worker/WorkerFactory.ts @@ -1,7 +1,8 @@ import { Worker, isMainThread } from 'worker_threads'; -import { WorkerData, WorkerOptions, WorkerProcessType } from '../types/Worker'; import { PoolOptions } from 'poolifier'; + +import { WorkerData, WorkerOptions, WorkerProcessType } from '../types/Worker'; import type WorkerAbstract from './WorkerAbstract'; import WorkerConstants from './WorkerConstants'; import WorkerDynamicPool from './WorkerDynamicPool'; @@ -19,7 +20,7 @@ export default class WorkerFactory { workerOptions?: WorkerOptions ): WorkerAbstract | null { if (!isMainThread) { - throw new Error('Trying to get a worker implementation outside the main thread'); + throw new Error('Cannot get a worker implementation outside the main thread'); } workerOptions = workerOptions ?? ({} as WorkerOptions); workerOptions.workerStartDelay =