+// 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';
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);
+ }
}
});
}