X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Futils%2FConfiguration.ts;h=8770a9b9f3ec48cf5859d52b8a2383585a4b8351;hb=418106c832022ba6f100f4bf81315300994bee87;hp=760695253531f6c64863315287eb36063895b5a7;hpb=963ee397d378bffb9d41154a38bd6a83e4ac0fb8;p=e-mobility-charging-stations-simulator.git diff --git a/src/utils/Configuration.ts b/src/utils/Configuration.ts index 76069525..8770a9b9 100644 --- a/src/utils/Configuration.ts +++ b/src/utils/Configuration.ts @@ -41,8 +41,13 @@ export default class Configuration { return Configuration.getConfig().useWorkerPool; } - static getWorkerPoolSize(): number { - return Configuration.getConfig().workerPoolSize; + static getWorkerPoolMaxSize(): number { + Configuration.deprecateConfigurationKey('workerPoolSize;', 'Use \'workerPoolMaxSize\' instead'); + return Configuration.useWorkerPool() && Configuration.objectHasOwnProperty(Configuration.getConfig(), 'workerPoolMaxSize') ? Configuration.getConfig().workerPoolMaxSize : 16; + } + + static getChargingStationsPerWorker(): number { + return Configuration.objectHasOwnProperty(Configuration.getConfig(), 'chargingStationsPerWorker') ? Configuration.getConfig().chargingStationsPerWorker : 1; } static getLogConsole(): boolean { @@ -100,7 +105,7 @@ export default class Configuration { } private static objectHasOwnProperty(object: any, property: string): boolean { - return Object.prototype.hasOwnProperty.call(object, property); + return Object.prototype.hasOwnProperty.call(object, property) as boolean; } private static isUndefined(obj: any): boolean {