From: Jérôme Benoit Date: Sat, 27 May 2023 12:37:24 +0000 (+0200) Subject: fix: clone ATG connector status before altering it X-Git-Tag: v1.2.15~33 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=56c298254011750a08c6be90d94c098c31f6bdc3;p=e-mobility-charging-stations-simulator.git fix: clone ATG connector status before altering it Signed-off-by: Jérôme Benoit --- diff --git a/src/charging-station/AutomaticTransactionGenerator.ts b/src/charging-station/AutomaticTransactionGenerator.ts index b87eaab3..477a8d9c 100644 --- a/src/charging-station/AutomaticTransactionGenerator.ts +++ b/src/charging-station/AutomaticTransactionGenerator.ts @@ -330,8 +330,9 @@ export class AutomaticTransactionGenerator extends AsyncResource { } private getConnectorStatus(connectorId: number): Status { - const connectorStatus = - this.chargingStation.getAutomaticTransactionGeneratorStatuses()[connectorId]; + const connectorStatus = Utils.cloneObject( + this.chargingStation.getAutomaticTransactionGeneratorStatuses() + )[connectorId]; delete connectorStatus?.startDate; delete connectorStatus?.lastRunDate; delete connectorStatus?.stopDate;