fix: stop reservation expiration check at stop
authorJérôme Benoit <jerome.benoit@sap.com>
Wed, 26 Jul 2023 06:34:29 +0000 (08:34 +0200)
committerJérôme Benoit <jerome.benoit@sap.com>
Wed, 26 Jul 2023 06:34:29 +0000 (08:34 +0200)
Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
src/charging-station/ChargingStation.ts
src/charging-station/ChargingStationUtils.ts

index 70390b152dd9356219c9ba2d2ced00a9d9c1c002..6f4b4a130d0214095ab7c86fff4538b98f1ee1a8 100644 (file)
@@ -731,6 +731,9 @@ export class ChargingStation {
         if (this.getEnableStatistics() === true) {
           this.performanceStatistics?.stop();
         }
+        if (this.hasFeatureProfile(SupportedFeatureProfiles.Reservation)) {
+          this.stopReservationExpirationSetInterval();
+        }
         this.sharedLRUCache.deleteChargingStationConfiguration(this.configurationFileHash);
         this.templateFileWatcher?.close();
         this.sharedLRUCache.deleteChargingStationTemplate(this.templateFileHash);
index fa83499020fdd4564db5a7d191dc311b556c9074..b35f0260ad78d84058dc317797aebb67f66a5c8e 100644 (file)
@@ -703,7 +703,7 @@ const getLimitFromChargingProfiles = (
       continue;
     }
     const chargingSchedule = chargingProfile.chargingSchedule;
-    if (connectorStatus?.transactionStarted && !chargingSchedule?.startSchedule) {
+    if (connectorStatus?.transactionStarted && isNullOrUndefined(chargingSchedule?.startSchedule)) {
       logger.debug(
         `${logPrefix} ${moduleName}.getLimitFromChargingProfiles: Charging profile id ${chargingProfile.chargingProfileId} has no startSchedule defined. Trying to set it to the connector current transaction start date`,
       );