X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Fcharging-station%2FBootstrap.ts;h=809c623ab51062db24812fefac5f780be76e63ab;hb=c52f1f49e485e8f75682f5ce974d54144cbe2b7c;hp=10344b5130026e4eb791758d13089eb294d5272b;hpb=b322b8b4712bd412ea2d1e27924dcc6f1bb08c63;p=e-mobility-charging-stations-simulator.git diff --git a/src/charging-station/Bootstrap.ts b/src/charging-station/Bootstrap.ts index 10344b51..809c623a 100644 --- a/src/charging-station/Bootstrap.ts +++ b/src/charging-station/Bootstrap.ts @@ -1,6 +1,6 @@ // Partial Copyright Jerome Benoit. 2021. All Rights Reserved. -import { ChargingStationWorkerData, WorkerMessage, WorkerMessageEvents } from '../types/Worker'; +import { ChargingStationWorkerData, ChargingStationWorkerMessage, ChargingStationWorkerMessageEvents } from '../types/ChargingStationWorker'; import Configuration from '../utils/Configuration'; import { Storage } from '../performance/storage/Storage'; @@ -18,9 +18,9 @@ export default class Bootstrap { private static workerImplementation: WorkerAbstract | null = null; private static storage: Storage; private static numberOfChargingStations: number; - private version: string = version; + private readonly version: string = version; private started: boolean; - private workerScript: string; + private readonly workerScript: string; private constructor() { this.started = false; @@ -103,8 +103,8 @@ export default class Bootstrap { poolOptions: { workerChoiceStrategy: Configuration.getWorkerPoolStrategy() }, - messageHandler: async (msg: WorkerMessage) => { - if (msg.id === WorkerMessageEvents.PERFORMANCE_STATISTICS) { + messageHandler: async (msg: ChargingStationWorkerMessage) => { + if (msg.id === ChargingStationWorkerMessageEvents.PERFORMANCE_STATISTICS) { await Bootstrap.storage.storePerformanceStatistics(msg.data); } }