From a1256107ac163ec1680404e6e2872adc6ce39185 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Sun, 2 May 2021 21:16:23 +0200 Subject: [PATCH] Fix ATG start blocking call MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit --- src/charging-station/AutomaticTransactionGenerator.ts | 2 +- src/charging-station/ChargingStation.ts | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) 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 -- 2.34.1