Make the worker start delay a tunable.
[e-mobility-charging-stations-simulator.git] / src / utils / Configuration.ts
index 552fab21dc21bb764b179a7ca49078c2ae4214f4..4bc1853d2d8543db22b4f8c3d35996100467dcc1 100644 (file)
@@ -1,5 +1,6 @@
 import ConfigurationData, { StationTemplateURL } from '../types/ConfigurationData';
 
+import Constants from './Constants';
 import { WorkerProcessType } from '../types/Worker';
 import fs from 'fs';
 import path from 'path';
@@ -51,6 +52,10 @@ export default class Configuration {
     return Configuration.objectHasOwnProperty(Configuration.getConfig(), 'workerProcess') ? Configuration.getConfig().workerProcess : WorkerProcessType.WORKER_SET;
   }
 
+  static getWorkerStartDelay(): number {
+    return Configuration.objectHasOwnProperty(Configuration.getConfig(), 'workerStartDelay') ? Configuration.getConfig().workerStartDelay : Constants.WORKER_START_DELAY;
+  }
+
   static getWorkerPoolMinSize(): number {
     return Configuration.objectHasOwnProperty(Configuration.getConfig(), 'workerPoolMinSize') ? Configuration.getConfig().workerPoolMinSize : 4;
   }