X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;ds=sidebyside;f=src%2Fcharging-station%2FChargingStationWorker.ts;h=c720b21980ae6ad2cf9165054a949c122c27061b;hb=9b4d0c7011a9b8ae65a0ee95193788265acb95ae;hp=3a1859a4a027057d99541b403a7464c5966310a1;hpb=2896e06dc8d72adf7150b23c941079f622f6f37c;p=e-mobility-charging-stations-simulator.git diff --git a/src/charging-station/ChargingStationWorker.ts b/src/charging-station/ChargingStationWorker.ts index 3a1859a4..c720b219 100644 --- a/src/charging-station/ChargingStationWorker.ts +++ b/src/charging-station/ChargingStationWorker.ts @@ -1,12 +1,12 @@ // Partial Copyright Jerome Benoit. 2021-2023. All Rights Reserved. -import { parentPort, workerData } from 'worker_threads'; +import { parentPort, workerData } from 'node:worker_threads'; import { ThreadWorker } from 'poolifier'; import { ChargingStation, ChargingStationUtils } from './internal'; import type { ChargingStationWorkerData } from '../types'; -import { Utils } from '../utils/Utils'; +import { Utils } from '../utils'; import { WorkerConstants, type WorkerMessage, WorkerMessageEvents } from '../worker'; // Conditionally export ThreadWorker instance for pool usage @@ -29,7 +29,7 @@ if (ChargingStationUtils.workerPoolInUse()) { */ function addMessageListener(): void { parentPort?.on('message', (message: WorkerMessage) => { - if (message.id === WorkerMessageEvents.START_WORKER_ELEMENT) { + if (message.id === WorkerMessageEvents.startWorkerElement) { startChargingStation(message.data); } });