perf: optimize fixed pool busyness detection
authorJérôme Benoit <jerome.benoit@sap.com>
Mon, 10 Apr 2023 04:07:04 +0000 (06:07 +0200)
committerJérôme Benoit <jerome.benoit@sap.com>
Mon, 10 Apr 2023 04:07:04 +0000 (06:07 +0200)
Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
src/pools/abstract-pool.ts

index 661eb7b6ec363c228ad0c540f43b44361b76e75e..1a1a89fbcb57043c975e561e52b9962d68f35a3a 100644 (file)
@@ -214,10 +214,7 @@ export abstract class AbstractPool<
   public abstract get busy (): boolean
 
   protected internalBusy (): boolean {
-    return (
-      this.numberOfRunningTasks >= this.numberOfWorkers &&
-      this.findFreeWorkerNodeKey() === -1
-    )
+    return this.findFreeWorkerNodeKey() === -1
   }
 
   /** @inheritDoc */