Force WS connection opened closing at connection retries
authorJérôme Benoit <jerome.benoit@sap.com>
Sat, 18 Sep 2021 11:32:43 +0000 (13:32 +0200)
committerJérôme Benoit <jerome.benoit@sap.com>
Sat, 18 Sep 2021 11:32:43 +0000 (13:32 +0200)
Signed-off-by: Jérôme Benoit <jerome.benoit@piment-noir.org>
src/charging-station/ChargingStation.ts

index 833783aa68281f9fce8c1c0731fcfdd7ac191432..35bbdd49debaaefd841d822dbe133c6368ec9b75 100644 (file)
@@ -1053,7 +1053,7 @@ export default class ChargingStation {
       logger.error(`${this.logPrefix()} Socket: connection retry in ${Utils.roundTo(reconnectDelay, 2)}ms, timeout ${reconnectDelay - 100}ms`);
       await Utils.sleep(reconnectDelay);
       logger.error(this.logPrefix() + ' Socket: reconnecting try #' + this.autoReconnectRetryCount.toString());
-      this.openWSConnection({ handshakeTimeout: reconnectDelay - 100 });
+      this.openWSConnection({ handshakeTimeout: reconnectDelay - 100 }, true);
       this.hasSocketRestarted = true;
     } else if (this.getAutoReconnectMaxRetries() !== -1) {
       logger.error(`${this.logPrefix()} Socket reconnect failure: max retries reached (${this.autoReconnectRetryCount}) or retry disabled (${this.getAutoReconnectMaxRetries()})`);