From: Jérôme Benoit Date: Mon, 3 Jul 2023 20:55:04 +0000 (+0200) Subject: fix: fix availableParallelism() usage for min pool size X-Git-Tag: v1.2.18~82 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;ds=sidebyside;h=cc5065999da6bae0caa463848ce4612d65484316;p=e-mobility-charging-stations-simulator.git fix: fix availableParallelism() usage for min pool size Signed-off-by: Jérôme Benoit --- diff --git a/src/worker/WorkerConstants.ts b/src/worker/WorkerConstants.ts index 4e0bce1f..e7572db3 100644 --- a/src/worker/WorkerConstants.ts +++ b/src/worker/WorkerConstants.ts @@ -8,7 +8,7 @@ export class WorkerConstants { public static readonly DEFAULT_ELEMENT_START_DELAY = 0; public static readonly DEFAULT_WORKER_START_DELAY = 500; public static readonly POOL_MAX_INACTIVE_TIME = 60000; - public static readonly DEFAULT_POOL_MIN_SIZE = availableParallelism() / 2; + public static readonly DEFAULT_POOL_MIN_SIZE = Math.floor(availableParallelism() / 2); public static readonly DEFAULT_POOL_MAX_SIZE = availableParallelism(); public static readonly DEFAULT_ELEMENTS_PER_WORKER = 1;