From 6b2f4370c8c7c06fd1b6939134f737cdad24171d Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Thu, 29 Jun 2023 00:31:18 +0200 Subject: [PATCH] refactor: cleanup worker export 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 | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) 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 { -- 2.34.1