fix: clear idtags cache at template file change
authorJérôme Benoit <jerome.benoit@sap.com>
Fri, 7 Jul 2023 20:51:14 +0000 (22:51 +0200)
committerJérôme Benoit <jerome.benoit@sap.com>
Fri, 7 Jul 2023 20:51:14 +0000 (22:51 +0200)
Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
src/charging-station/ChargingStation.ts

index ba43ff985da31965f8900c21666361844b782c52..77e93ed6fbf8858a043166bde6a71d803764d51f 100644 (file)
@@ -698,9 +698,9 @@ export class ChargingStation {
                   } file have changed, reload`
                 );
                 this.sharedLRUCache.deleteChargingStationTemplate(this.templateFileHash);
-                // FIXME: cleanup idtags cache if idtags file has changed
                 // Initialize
                 this.initialize();
+                this.idTagsCache.deleteIdTags(getIdTagsFile(this.stationInfo));
                 // Restart the ATG
                 this.stopAutomaticTransactionGenerator();
                 if (this.getAutomaticTransactionGeneratorConfiguration()?.enable === true) {
@@ -984,9 +984,9 @@ export class ChargingStation {
       case ReservationTerminationReason.TRANSACTION_STARTED:
         delete connector.reservation;
         break;
-      case ReservationTerminationReason.RESERVATION_CANCELED ||
-        ReservationTerminationReason.REPLACE_EXISTING ||
-        ReservationTerminationReason.EXPIRED:
+      case ReservationTerminationReason.RESERVATION_CANCELED:
+      case ReservationTerminationReason.REPLACE_EXISTING:
+      case ReservationTerminationReason.EXPIRED:
         await OCPPServiceUtils.sendAndSetConnectorStatus(
           this,
           reservation.connectorId,