Import cleanups
[e-mobility-charging-stations-simulator.git] / src / charging-station / AutomaticTransactionGenerator.ts
index 2548836022a7e7381d51002a37a487f52309380e..80c9a5176937a035dccc699fc39e6e6b2859a88d 100644 (file)
@@ -1,4 +1,4 @@
-// Partial Copyright Jerome Benoit. 2021. All Rights Reserved.
+// Partial Copyright Jerome Benoit. 2021-2023. All Rights Reserved.
 
 import { AsyncResource } from 'async_hooks';
 
@@ -455,9 +455,10 @@ export default class AutomaticTransactionGenerator extends AsyncResource {
   }
 
   private checkChargingStation(connectorId?: number): boolean {
-    if (this.chargingStation.started === false) {
+    if (this.chargingStation.started === false && this.chargingStation.starting === false) {
       logger.warn(`${this.logPrefix(connectorId)} charging station is stopped, cannot proceed`);
+      return false;
     }
-    return this.chargingStation.started;
+    return true;
   }
 }