fix: clone ATG connector status before altering it
authorJérôme Benoit <jerome.benoit@sap.com>
Sat, 27 May 2023 12:37:24 +0000 (14:37 +0200)
committerJérôme Benoit <jerome.benoit@sap.com>
Sat, 27 May 2023 12:37:24 +0000 (14:37 +0200)
Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
src/charging-station/AutomaticTransactionGenerator.ts

index b87eaab3d3b87d33cbd7b05dbcae028b9e01fb14..477a8d9c824f2922cb178631d5156ee840a96878 100644 (file)
@@ -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;