Skip to content

Commit d9ac47e

Browse files
committed
ATG: fix start transaction counting with no authentication
Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
1 parent 7acb3f7 commit d9ac47e

1 file changed

Lines changed: 15 additions & 7 deletions

File tree

‎src/charging-station/AutomaticTransactionGenerator.ts‎

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -309,13 +309,7 @@ export default class AutomaticTransactionGenerator {
309309
connectorId,
310310
idTag,
311311
});
312-
this.connectorsStatus.get(connectorId).startTransactionRequests++;
313-
if (startResponse?.idTagInfo?.status === AuthorizationStatus.ACCEPTED) {
314-
this.connectorsStatus.get(connectorId).acceptedStartTransactionRequests++;
315-
} else {
316-
logger.warn(this.logPrefix(connectorId) + ' start transaction rejected');
317-
this.connectorsStatus.get(connectorId).rejectedStartTransactionRequests++;
318-
}
312+
this.handleStartTransactionResponse(connectorId, startResponse);
319313
PerformanceStatistics.endMeasure(measureId, beginId);
320314
return startResponse;
321315
}
@@ -332,6 +326,7 @@ export default class AutomaticTransactionGenerator {
332326
connectorId,
333327
idTag,
334328
});
329+
this.handleStartTransactionResponse(connectorId, startResponse);
335330
PerformanceStatistics.endMeasure(measureId, beginId);
336331
return startResponse;
337332
}
@@ -382,4 +377,17 @@ export default class AutomaticTransactionGenerator {
382377
}:`
383378
);
384379
}
380+
381+
private handleStartTransactionResponse(
382+
connectorId: number,
383+
startResponse: StartTransactionResponse
384+
): void {
385+
this.connectorsStatus.get(connectorId).startTransactionRequests++;
386+
if (startResponse?.idTagInfo?.status === AuthorizationStatus.ACCEPTED) {
387+
this.connectorsStatus.get(connectorId).acceptedStartTransactionRequests++;
388+
} else {
389+
logger.warn(this.logPrefix(connectorId) + ' start transaction rejected');
390+
this.connectorsStatus.get(connectorId).rejectedStartTransactionRequests++;
391+
}
392+
}
385393
}

0 commit comments

Comments
 (0)