Fix Boostrap singleton class direct call
authorJérôme Benoit <jerome.benoit@sap.com>
Sun, 27 Jun 2021 13:06:26 +0000 (15:06 +0200)
committerJérôme Benoit <jerome.benoit@sap.com>
Sun, 27 Jun 2021 13:06:26 +0000 (15:06 +0200)
Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
src/charging-station/Bootstrap.ts
src/charging-station/ChargingStation.ts

index 97c231cb08acd3020496f538a48638a9936e32b1..a9e6d1ef70d1491ee4c1d68cc33092a95c4db117 100644 (file)
@@ -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 {
index 9d2b687448d37c1063eda0cd6ff98831e6de7484..4c3179f45d18c0bf3b1bf8f007615c0ae23e1ed7 100644 (file)
@@ -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;
         }