From: Jérôme Benoit Date: Wed, 26 Jul 2023 06:34:29 +0000 (+0200) Subject: fix: stop reservation expiration check at stop X-Git-Tag: v1.2.20~131 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=5543b88d23c7a36c74dfdeeb8a544bea1d992210;p=e-mobility-charging-stations-simulator.git fix: stop reservation expiration check at stop Signed-off-by: Jérôme Benoit --- diff --git a/src/charging-station/ChargingStation.ts b/src/charging-station/ChargingStation.ts index 70390b15..6f4b4a13 100644 --- a/src/charging-station/ChargingStation.ts +++ b/src/charging-station/ChargingStation.ts @@ -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); diff --git a/src/charging-station/ChargingStationUtils.ts b/src/charging-station/ChargingStationUtils.ts index fa834990..b35f0260 100644 --- a/src/charging-station/ChargingStationUtils.ts +++ b/src/charging-station/ChargingStationUtils.ts @@ -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`, );