fix: reset simulator state on stop/start cycle
authorJérôme Benoit <jerome.benoit@sap.com>
Wed, 21 Feb 2024 17:22:42 +0000 (18:22 +0100)
committerJérôme Benoit <jerome.benoit@sap.com>
Wed, 21 Feb 2024 17:22:42 +0000 (18:22 +0100)
State save and restoration is planned for later. Until then, the
configuration file is the reference at start.

Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
src/charging-station/Bootstrap.ts

index 5ee1f2c0ccf8b3fb2fa1ae94282f8c47fc244bf7..433b04cda951fe7486be9d1d78d9368f33ff912a 100644 (file)
@@ -262,6 +262,7 @@ export class Bootstrap extends EventEmitter {
         delete this.workerImplementation
         this.removeAllListeners()
         this.uiServer?.chargingStations.clear()
+        this.initializedCounters = false
         await this.storage?.close()
         delete this.storage
         this.started = false
@@ -278,7 +279,6 @@ export class Bootstrap extends EventEmitter {
     await this.stop()
     Configuration.getConfigurationSection<UIServerConfiguration>(ConfigurationSection.uiServer)
       .enabled !== true && this.uiServer?.stop()
-    this.initializedCounters = false
     await this.start()
   }