X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Fcharging-station%2FChargingStationWorker.ts;h=cc0f62726a174350095ade3fd4805a0204c753bd;hb=1864d7f5e1f7bdb0f696804c2e2c3694cec5a3d3;hp=81e0296d8761eca012b63085553df13615b14980;hpb=2a370053f45f2d58e90ab7b292294c521a262ca1;p=e-mobility-charging-stations-simulator.git diff --git a/src/charging-station/ChargingStationWorker.ts b/src/charging-station/ChargingStationWorker.ts index 81e0296d..cc0f6272 100644 --- a/src/charging-station/ChargingStationWorker.ts +++ b/src/charging-station/ChargingStationWorker.ts @@ -1,6 +1,6 @@ // Partial Copyright Jerome Benoit. 2021. All Rights Reserved. -import { ChargingStationWorkerData, WorkerMessage, WorkerMessageEvents } from '../types/Worker'; +import { ChargingStationWorkerData, ChargingStationWorkerMessage, ChargingStationWorkerMessageEvents } from '../types/ChargingStationWorker'; import { parentPort, workerData } from 'worker_threads'; import ChargingStation from './ChargingStation'; @@ -24,8 +24,8 @@ if (Utils.workerPoolInUse()) { * Listen messages send by the main thread */ function addMessageListener(): void { - parentPort?.on('message', (message: WorkerMessage) => { - if (message.id === WorkerMessageEvents.START_WORKER_ELEMENT) { + parentPort?.on('message', (message: ChargingStationWorkerMessage) => { + if (message.id === ChargingStationWorkerMessageEvents.START_WORKER_ELEMENT) { startChargingStation(message.data); } });