- if (this._chargingStation._connectors[connectorId].transactionStarted) {
- logger.info(this._logPrefix(connectorId) + ' stop transaction ' + this._chargingStation._connectors[connectorId].transactionId);
- const stopTransaction = performance.timerify(this.stopTransaction);
- this._performanceObserver.observe({entryTypes: ['function']});
- await stopTransaction(connectorId, this);
+ if (this._chargingStation.getConnector(connectorId).transactionStarted) {
+ logger.info(this._logPrefix(connectorId) + ' stop transaction ' + this._chargingStation.getConnector(connectorId).transactionId);
+ if (this._chargingStation.getEnableStatistics()) {
+ const stopTransaction = performance.timerify(this.stopTransaction);
+ this._performanceObserver.observe({entryTypes: ['function']});
+ await stopTransaction(connectorId, this);
+ } else {
+ await this.stopTransaction(connectorId, this);
+ }