X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Fcharging-station%2FBootstrap.ts;h=fe344407dc03400970fc89fb911f45011ce422b5;hb=ee0f106b09f38b1561d970ea4377eb199389298e;hp=06bc50e391695090eb25d6e469a98c5e5be7ce3d;hpb=3b04a25c2969e6f6d60c4b394656863673614e88;p=e-mobility-charging-stations-simulator.git diff --git a/src/charging-station/Bootstrap.ts b/src/charging-station/Bootstrap.ts index 06bc50e3..fe344407 100644 --- a/src/charging-station/Bootstrap.ts +++ b/src/charging-station/Bootstrap.ts @@ -109,7 +109,11 @@ export default class Bootstrap { workerChoiceStrategy: Configuration.getWorkerPoolStrategy() }, messageHandler: async (msg: ChargingStationWorkerMessage) => { - if (msg.id === ChargingStationWorkerMessageEvents.PERFORMANCE_STATISTICS) { + if (msg.id === ChargingStationWorkerMessageEvents.STARTED) { + this.webSocketServer.webSocketServerService.chargingStations.add(msg.data.id); + } else if (msg.id === ChargingStationWorkerMessageEvents.STOPPED) { + this.webSocketServer.webSocketServerService.chargingStations.delete(msg.data.id); + } else if (msg.id === ChargingStationWorkerMessageEvents.PERFORMANCE_STATISTICS) { await this.storage.storePerformanceStatistics(msg.data); } }