From: Jérôme Benoit Date: Sun, 27 Jun 2021 13:06:26 +0000 (+0200) Subject: Fix Boostrap singleton class direct call X-Git-Tag: v1.0.25~4 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=8e4e1939784c644ae9cfd3f23dce1e4cf9f80ddd;p=e-mobility-charging-stations-simulator.git Fix Boostrap singleton class direct call Signed-off-by: Jérôme Benoit --- diff --git a/src/charging-station/Bootstrap.ts b/src/charging-station/Bootstrap.ts index 97c231cb..a9e6d1ef 100644 --- a/src/charging-station/Bootstrap.ts +++ b/src/charging-station/Bootstrap.ts @@ -17,7 +17,7 @@ export default class Bootstrap { private constructor() { this.started = false; this.workerScript = path.join(path.resolve(__dirname, '../'), 'charging-station', 'StationWorker.js'); - Configuration.setConfigurationChangeCallback(async () => this.restart()); + Configuration.setConfigurationChangeCallback(async () => await Bootstrap.getInstance().restart()); } public static getInstance(): Bootstrap { diff --git a/src/charging-station/ChargingStation.ts b/src/charging-station/ChargingStation.ts index 9d2b6874..4c3179f4 100644 --- a/src/charging-station/ChargingStation.ts +++ b/src/charging-station/ChargingStation.ts @@ -375,7 +375,7 @@ export default class ChargingStation { if (!Utils.isEmptyArray(this.getConnector(connectorId).chargingProfiles)) { this.getConnector(connectorId).chargingProfiles?.forEach((chargingProfile: ChargingProfile, index: number) => { if (chargingProfile.chargingProfileId === cp.chargingProfileId - || (chargingProfile.stackLevel === cp.stackLevel && chargingProfile.chargingProfilePurpose === cp.chargingProfilePurpose)) { + || (chargingProfile.stackLevel === cp.stackLevel && chargingProfile.chargingProfilePurpose === cp.chargingProfilePurpose)) { this.getConnector(connectorId).chargingProfiles[index] = cp; return true; }