X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Fcharging-station%2FChargingStationWorker.ts;h=19f760e74565061f0b0e1e18cb74f2b0fdcbbd6d;hb=fba11dc656de000473d0639be238c8151f217d93;hp=741449e3b63e9b8126e4440c9c143116b61156b7;hpb=d58b442097da31f8b974d51aef63c64470d9ab48;p=e-mobility-charging-stations-simulator.git diff --git a/src/charging-station/ChargingStationWorker.ts b/src/charging-station/ChargingStationWorker.ts index 741449e3..19f760e7 100644 --- a/src/charging-station/ChargingStationWorker.ts +++ b/src/charging-station/ChargingStationWorker.ts @@ -13,7 +13,7 @@ import { WorkerConstants, type WorkerMessage, WorkerMessageEvents } from '../wor const moduleName = 'ChargingStationWorker'; /** - * Create and start a charging station instance + * Creates and starts a charging station instance * * @param data - workerData */ @@ -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 {