From: Jérôme Benoit Date: Thu, 2 Feb 2023 20:39:53 +0000 (+0100) Subject: refactor(simulator): remove unneeded duplicate initialization at startup X-Git-Tag: v1.1.93~21 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=af8e02ca9a957f78366251dd2e2b818c7b398dd4;p=e-mobility-charging-stations-simulator.git refactor(simulator): remove unneeded duplicate initialization at startup Signed-off-by: Jérôme Benoit --- diff --git a/src/charging-station/Bootstrap.ts b/src/charging-station/Bootstrap.ts index b1495243..7a823e56 100644 --- a/src/charging-station/Bootstrap.ts +++ b/src/charging-station/Bootstrap.ts @@ -49,17 +49,16 @@ export class Bootstrap { private readonly workerScript: string; private constructor() { - this.started = false; - this.workerImplementation = null; // Enable unconditionally for now this.logUnhandledRejection(); this.logUncaughtException(); + this.started = false; + this.workerImplementation = null; this.workerScript = path.join( path.resolve(path.dirname(fileURLToPath(import.meta.url)), '../'), 'charging-station', `ChargingStationWorker${path.extname(fileURLToPath(import.meta.url))}` ); - this.initializeCounters(); Configuration.getUIServer().enabled === true && (this.uiServer = UIServerFactory.getUIServerImplementation(Configuration.getUIServer())); Configuration.getPerformanceStorage().enabled === true && @@ -145,8 +144,6 @@ export class Bootstrap { public async restart(): Promise { await this.stop(); - this.initializeCounters(); - this.initializeWorkerImplementation(); await this.start(); }