Use IIFE (https://developer.mozilla.org/en-US/docs/Glossary/IIFE) for
[e-mobility-charging-stations-simulator.git] / src / charging-station / Bootstrap.ts
index 6bcc8511f487fd36db4289aeb3d82dbaa46b2e34..a982cb694f04844a55a0ff213ab3a17782f13400 100644 (file)
@@ -95,11 +95,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);
+          }
         }
       });
   }