From ca47912d4ef0ca7608be49e62aadb6a931d74359 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Thu, 1 Jun 2023 04:07:56 +0200 Subject: [PATCH] fix: ensure all charging stations are started as an async resource MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit --- src/charging-station/ChargingStationWorker.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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) { -- 2.34.1