From: Jérôme Benoit Date: Thu, 1 Jun 2023 02:07:56 +0000 (+0200) Subject: fix: ensure all charging stations are started as an async resource X-Git-Tag: v1.2.16~24 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=ca47912d4ef0ca7608be49e62aadb6a931d74359;p=e-mobility-charging-stations-simulator.git fix: ensure all charging stations are started as an async resource Signed-off-by: Jérôme Benoit --- diff --git a/src/charging-station/ChargingStationWorker.ts b/src/charging-station/ChargingStationWorker.ts index 3fd74e36..19dd6f8d 100644 --- a/src/charging-station/ChargingStationWorker.ts +++ b/src/charging-station/ChargingStationWorker.ts @@ -39,10 +39,10 @@ if (Configuration.workerPoolInUse()) { ); } } - // Add message listener to start charging station from main thread + // Add message listener to create and start charging station from the main thread parentPort?.on('message', (message: WorkerMessage) => { if (message.id === WorkerMessageEvents.startWorkerElement) { - startChargingStation(message.data); + new ChargingStationWorker().run(message.data); } }); if (workerData !== undefined) {