X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Fcharging-station%2FBootstrap.ts;h=f33116726b318a85712b91e6b213f5b4634a87d4;hb=312ff77c62c6ba96ec1266a5d617b6910511f1c6;hp=6bcc8511f487fd36db4289aeb3d82dbaa46b2e34;hpb=2a370053f45f2d58e90ab7b292294c521a262ca1;p=e-mobility-charging-stations-simulator.git diff --git a/src/charging-station/Bootstrap.ts b/src/charging-station/Bootstrap.ts index 6bcc8511..f3311672 100644 --- a/src/charging-station/Bootstrap.ts +++ b/src/charging-station/Bootstrap.ts @@ -1,8 +1,10 @@ +// Partial Copyright Jerome Benoit. 2021. All Rights Reserved. + import { ChargingStationWorkerData, WorkerMessage, WorkerMessageEvents } from '../types/Worker'; import Configuration from '../utils/Configuration'; -import { Storage } from '../utils/performance-storage/Storage'; -import { StorageFactory } from '../utils/performance-storage/StorageFactory'; +import { Storage } from '../performance/storage/Storage'; +import { StorageFactory } from '../performance/storage/StorageFactory'; import Utils from '../utils/Utils'; import WorkerAbstract from '../worker/WorkerAbstract'; import WorkerFactory from '../worker/WorkerFactory'; @@ -95,11 +97,11 @@ export default class Bootstrap { elementsPerWorker: Configuration.getChargingStationsPerWorker(), poolOptions: { workerChoiceStrategy: Configuration.getWorkerPoolStrategy() - } - // eslint-disable-next-line @typescript-eslint/no-misused-promises - }, async (msg: WorkerMessage) => { - if (msg.id === WorkerMessageEvents.PERFORMANCE_STATISTICS) { - await Bootstrap.storage.storePerformanceStatistics(msg.data); + }, + messageHandler: async (msg: WorkerMessage) => { + if (msg.id === WorkerMessageEvents.PERFORMANCE_STATISTICS) { + await Bootstrap.storage.storePerformanceStatistics(msg.data); + } } }); }