From: Jérôme Benoit Date: Sun, 2 May 2021 19:16:23 +0000 (+0200) Subject: Fix ATG start blocking call X-Git-Tag: v1.0.1-0~42 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=a1256107ac163ec1680404e6e2872adc6ce39185;p=e-mobility-charging-stations-simulator.git Fix ATG start blocking call Signed-off-by: Jérôme Benoit --- diff --git a/src/charging-station/AutomaticTransactionGenerator.ts b/src/charging-station/AutomaticTransactionGenerator.ts index bb8d75b3..e675550f 100644 --- a/src/charging-station/AutomaticTransactionGenerator.ts +++ b/src/charging-station/AutomaticTransactionGenerator.ts @@ -53,7 +53,7 @@ export default class AutomaticTransactionGenerator { this.timeToStop = true; } - public async startConnector(connectorId: number): Promise { + private async startConnector(connectorId: number): Promise { do { if (this.timeToStop) { logger.error(this.logPrefix(connectorId) + ' Entered in transaction loop while a request to stop it was made'); diff --git a/src/charging-station/ChargingStation.ts b/src/charging-station/ChargingStation.ts index 44327562..6bff621f 100644 --- a/src/charging-station/ChargingStation.ts +++ b/src/charging-station/ChargingStation.ts @@ -728,7 +728,8 @@ export default class ChargingStation { this.automaticTransactionGeneration = new AutomaticTransactionGenerator(this); } if (this.automaticTransactionGeneration.timeToStop) { - await this.automaticTransactionGeneration.start(); + // The ATG might sleep + void this.automaticTransactionGeneration.start(); } } if (this.getEnableStatistics()) { @@ -865,7 +866,8 @@ export default class ChargingStation { this.automaticTransactionGeneration = new AutomaticTransactionGenerator(this); } if (this.automaticTransactionGeneration.timeToStop) { - await this.automaticTransactionGeneration.start(); + // The ATG might sleep + void this.automaticTransactionGeneration.start(); } } // FIXME?: restart heartbeat and WebSocket ping when their interval values have changed