From: Jérôme Benoit Date: Wed, 28 Jun 2023 22:31:18 +0000 (+0200) Subject: refactor: cleanup worker export X-Git-Tag: v1.2.17~7 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=6b2f4370c8c7c06fd1b6939134f737cdad24171d;p=e-mobility-charging-stations-simulator.git refactor: cleanup worker export Signed-off-by: Jérôme Benoit --- diff --git a/src/charging-station/ChargingStationWorker.ts b/src/charging-station/ChargingStationWorker.ts index 741449e3..8b89750b 100644 --- a/src/charging-station/ChargingStationWorker.ts +++ b/src/charging-station/ChargingStationWorker.ts @@ -37,11 +37,9 @@ class ChargingStationWorker extends AsyncResource { } } -export let chargingStationWorker: ChargingStationWorker; -// Conditionally export ThreadWorker instance for pool usage -export let threadWorker: ThreadWorker; +export let chargingStationWorker: ChargingStationWorker | ThreadWorker; if (Configuration.workerPoolInUse()) { - threadWorker = new ThreadWorker(startChargingStation, { + chargingStationWorker = new ThreadWorker(startChargingStation, { maxInactiveTime: WorkerConstants.POOL_MAX_INACTIVE_TIME, }); } else {