refactor: cleanup loops over object keys
[e-mobility-charging-stations-simulator.git] / src / charging-station / Bootstrap.ts
index e329a65b4e32ffa1018aa6b01a35b32ffacd0649..ba4d14a8369b36e6a0696027d66ec9fb7906e2ca 100644 (file)
@@ -7,7 +7,7 @@ import { isMainThread } from 'node:worker_threads';
 
 import chalk from 'chalk';
 
-import { waitForChargingStationEvents } from './ChargingStationUtils';
+import { waitChargingStationEvents } from './ChargingStationUtils';
 import type { AbstractUIServer } from './ui-server/AbstractUIServer';
 import { UIServerFactory } from './ui-server/UIServerFactory';
 import { version } from '../../package.json' assert { type: 'json' };
@@ -142,6 +142,12 @@ export class Bootstrap extends EventEmitter {
             }`
           )
         );
+        Configuration.workerDynamicPoolInUse() &&
+          console.warn(
+            chalk.yellow(
+              'Charging stations simulator is using dynamic pool mode. This is an experimental feature with known issues.\nPlease consider using static pool or worker set mode instead'
+            )
+          );
         console.info(chalk.green('Worker set/pool information:'), this.workerImplementation?.info);
         this.started = true;
         this.starting = false;
@@ -168,7 +174,7 @@ export class Bootstrap extends EventEmitter {
           )
         );
         await Promise.race([
-          waitForChargingStationEvents(
+          waitChargingStationEvents(
             this,
             ChargingStationWorkerMessageEvents.stopped,
             this.numberOfChargingStations