fix: make pool busyness check for worker readiness
authorJérôme Benoit <jerome.benoit@sap.com>
Fri, 21 Jul 2023 19:42:54 +0000 (21:42 +0200)
committerJérôme Benoit <jerome.benoit@sap.com>
Fri, 21 Jul 2023 19:42:54 +0000 (21:42 +0200)
Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
src/pools/abstract-pool.ts

index fa3406a376660c0de442be50778729187fc3fe02..d175cd5b0b8204fdb029ba9e2c35d7b52ac60522 100644 (file)
@@ -617,9 +617,10 @@ export abstract class AbstractPool<
    */
   protected internalBusy (): boolean {
     return (
-      this.workerNodes.findIndex(workerNode => {
-        return workerNode.usage.tasks.executing === 0
-      }) === -1
+      this.workerNodes.findIndex(
+        workerNode =>
+          workerNode.info.ready && workerNode.usage.tasks.executing === 0
+      ) === -1
     )
   }