fix: fix availableParallelism() usage for min pool size
authorJérôme Benoit <jerome.benoit@sap.com>
Mon, 3 Jul 2023 20:55:04 +0000 (22:55 +0200)
committerJérôme Benoit <jerome.benoit@sap.com>
Mon, 3 Jul 2023 20:55:04 +0000 (22:55 +0200)
Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
src/worker/WorkerConstants.ts

index 4e0bce1f86dca990f99be28649b0dafe50620488..e7572db3d5cc2eb92ff4b1a4238dc1447e7a1a25 100644 (file)
@@ -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;