- public async start(): Promise<void> {
- if (this.started === false) {
- if (this.starting === false) {
- this.starting = true;
- this.initializeCounters();
- this.workerConfiguration = Configuration.getConfigurationSection<WorkerConfiguration>(
- ConfigurationSection.worker,
- );
- this.initializeWorkerImplementation(this.workerConfiguration);
- await this.workerImplementation?.start();
+ public async start (): Promise<void> {
+ if (!this.started) {
+ if (!this.starting) {
+ this.starting = true
+ this.on(ChargingStationWorkerMessageEvents.started, this.workerEventStarted)
+ this.on(ChargingStationWorkerMessageEvents.stopped, this.workerEventStopped)
+ this.on(ChargingStationWorkerMessageEvents.updated, this.workerEventUpdated)
+ this.on(
+ ChargingStationWorkerMessageEvents.performanceStatistics,
+ this.workerEventPerformanceStatistics
+ )
+ this.initializeCounters()
+ const workerConfiguration = Configuration.getConfigurationSection<WorkerConfiguration>(
+ ConfigurationSection.worker
+ )
+ this.initializeWorkerImplementation(workerConfiguration)
+ await this.workerImplementation?.start()