From: Jérôme Benoit Date: Sun, 24 Jan 2021 19:22:57 +0000 (+0100) Subject: Fix charging stations counting. X-Git-Tag: v1.0.1-0~120 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=d392bb75a5f44c6d6cbecb17d8dde61c1f7ac8fa;hp=418106c832022ba6f100f4bf81315300994bee87;p=e-mobility-charging-stations-simulator.git Fix charging stations counting. Signed-off-by: Jérôme Benoit --- diff --git a/src/assets/station-templates/abb-atg.station-template.json b/src/assets/station-templates/abb-atg.station-template.json index c8297a1c..875eed45 100644 --- a/src/assets/station-templates/abb-atg.station-template.json +++ b/src/assets/station-templates/abb-atg.station-template.json @@ -64,7 +64,7 @@ "probabilityOfStart": 1, "stopAfterHours": 0.3, "stopOnConnectionFailure": false, - "requireAuthorize": false + "requireAuthorize": true }, "Connectors": { "0": {}, diff --git a/src/start.ts b/src/start.ts index 947a1abf..f316d0ad 100644 --- a/src/start.ts +++ b/src/start.ts @@ -30,7 +30,6 @@ class Bootstrap { if (Configuration.useWorkerPool()) { void workerImplementation.addElement(workerData); numConcurrentWorkers = workerImplementation.size; - numStationsTotal = workerImplementation.size; // Start worker sequentially to optimize memory at start time await Utils.sleep(Constants.START_WORKER_DELAY); } else { @@ -41,16 +40,15 @@ class Bootstrap { void workerImplementation.start(); numConcurrentWorkers++; chargingStationsPerWorkerCounter = 1; - numStationsTotal++; // Start worker sequentially to optimize memory at start time await Utils.sleep(Constants.START_WORKER_DELAY); } else { // Add charging station to existing WorkerGroup void workerImplementation.addElement(workerData); chargingStationsPerWorkerCounter++; - numStationsTotal++; } } + numStationsTotal++; } } catch (error) { // eslint-disable-next-line no-console