Refine the list of performance storage supported engines
[e-mobility-charging-stations-simulator.git] / src / charging-station / Bootstrap.ts
index 6bcc8511f487fd36db4289aeb3d82dbaa46b2e34..f33116726b318a85712b91e6b213f5b4634a87d4 100644 (file)
@@ -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);
+          }
         }
       });
   }