fix: fix worker configuration merge issue
[e-mobility-charging-stations-simulator.git] / src / charging-station / Bootstrap.ts
index 6eacfff46c462655a10a84d5209f545424694701..64953a9687a8f730a233ce7517ffa1f2842bbd3c 100644 (file)
@@ -366,7 +366,9 @@ export class Bootstrap extends EventEmitter {
         elementsPerWorker,
         poolOptions: {
           messageHandler: this.messageHandler.bind(this) as MessageHandler<Worker>,
-          workerOptions: { resourceLimits: workerConfiguration.resourceLimits }
+          ...(workerConfiguration.resourceLimits != null && {
+            workerOptions: { resourceLimits: workerConfiguration.resourceLimits }
+          })
         }
       }
     )