X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Fcharging-station%2FAutomaticTransactionGenerator.ts;h=a6d3031c88336801233beaba865ab68bf2c5abe6;hb=d12e7f3c812d4ce351492eb3b5da2722d261f331;hp=fb6e9d28c1f92ee7766104dd4559a79eeb94725e;hpb=083fb002e7ae10bf53cc5890d1e403d556c549f5;p=e-mobility-charging-stations-simulator.git diff --git a/src/charging-station/AutomaticTransactionGenerator.ts b/src/charging-station/AutomaticTransactionGenerator.ts index fb6e9d28..a6d3031c 100644 --- a/src/charging-station/AutomaticTransactionGenerator.ts +++ b/src/charging-station/AutomaticTransactionGenerator.ts @@ -93,10 +93,15 @@ export default class AutomaticTransactionGenerator extends AsyncResource { } if (this.connectorsStatus.get(connectorId)?.start === false) { this.runInAsyncScope( - this.internalStartConnector.bind(this) as (this: this, ...args: any[]) => unknown, + this.internalStartConnector.bind(this) as ( + this: AutomaticTransactionGenerator, + ...args: any[] + ) => Promise, this, connectorId - ); + ).catch(() => { + /* This is intentional */ + }); } else if (this.connectorsStatus.get(connectorId)?.start === true) { logger.warn(`${this.logPrefix(connectorId)} is already started on connector`); } @@ -152,7 +157,7 @@ export default class AutomaticTransactionGenerator extends AsyncResource { this.stopConnector(connectorId); break; } - if (!this.chargingStation.isInAcceptedState()) { + if (this.chargingStation.isInAcceptedState() === false) { logger.error( this.logPrefix(connectorId) + ' entered in transaction loop while the charging station is not in accepted state' @@ -160,7 +165,7 @@ export default class AutomaticTransactionGenerator extends AsyncResource { this.stopConnector(connectorId); break; } - if (!this.chargingStation.isChargingStationAvailable()) { + if (this.chargingStation.isChargingStationAvailable() === false) { logger.info( this.logPrefix(connectorId) + ' entered in transaction loop while the charging station is unavailable' @@ -168,7 +173,7 @@ export default class AutomaticTransactionGenerator extends AsyncResource { this.stopConnector(connectorId); break; } - if (!this.chargingStation.isConnectorAvailable(connectorId)) { + if (this.chargingStation.isConnectorAvailable(connectorId) === false) { logger.info( `${this.logPrefix( connectorId