Fix charging stations counting.
authorJérôme Benoit <jerome.benoit@sap.com>
Sun, 24 Jan 2021 19:22:57 +0000 (20:22 +0100)
committerJérôme Benoit <jerome.benoit@sap.com>
Sun, 24 Jan 2021 19:22:57 +0000 (20:22 +0100)
Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
src/assets/station-templates/abb-atg.station-template.json
src/start.ts

index c8297a1cf397abb7a22c04f33914803a6427e3e7..875eed4577c51be45108cc165a10e0de0c431749 100644 (file)
@@ -64,7 +64,7 @@
     "probabilityOfStart": 1,
     "stopAfterHours": 0.3,
     "stopOnConnectionFailure": false,
-    "requireAuthorize": false
+    "requireAuthorize": true
   },
   "Connectors": {
     "0": {},
index 947a1abfd15011ae208529f92f7edd1ed41cb98e..f316d0ad3d2ef6ea88090a87f71c511a69439346 100644 (file)
@@ -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