X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Fcharging-station%2FChargingStationWorker.ts;h=60d065642c7ef94585aa6902bf839354339dc6aa;hb=b9da1bc288a2a6ffccfbca6cd19aa195bc6ccfbf;hp=0ae95a618913e724eaab7c0dd8d509d4590b0e8c;hpb=aa7d6d9568ce5ec481a0a230f4ae24c9ee9d44fa;p=e-mobility-charging-stations-simulator.git diff --git a/src/charging-station/ChargingStationWorker.ts b/src/charging-station/ChargingStationWorker.ts index 0ae95a61..60d06564 100644 --- a/src/charging-station/ChargingStationWorker.ts +++ b/src/charging-station/ChargingStationWorker.ts @@ -6,7 +6,7 @@ import { ThreadWorker } from 'poolifier'; import { ChargingStation } from './ChargingStation'; import type { ChargingStationWorkerData } from '../types'; -import { Configuration, Utils } from '../utils'; +import { Configuration } from '../utils'; import { WorkerConstants, type WorkerMessage, WorkerMessageEvents } from '../worker'; /** @@ -35,12 +35,11 @@ export let threadWorker: ThreadWorker; if (Configuration.workerPoolInUse()) { threadWorker = new ThreadWorker(startChargingStation, { maxInactiveTime: WorkerConstants.POOL_MAX_INACTIVE_TIME, - async: false, }); } else { // Add message listener to start charging station from main thread addMessageListener(); - if (Utils.isUndefined(workerData) === false) { + if (workerData !== undefined) { startChargingStation(workerData as ChargingStationWorkerData); } }