From 241cf15ea44259be2ec66970c3137f99071f4e41 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Sun, 27 Aug 2023 12:57:51 +0200 Subject: [PATCH] fix: revert incorrect change MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit --- src/pools/abstract-pool.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/pools/abstract-pool.ts b/src/pools/abstract-pool.ts index 2a28893d..2820f8e3 100644 --- a/src/pools/abstract-pool.ts +++ b/src/pools/abstract-pool.ts @@ -1301,7 +1301,11 @@ export abstract class AbstractPool< ...(sourceWorkerNode.popTask() as Task), workerId: workerNode.info.id as number } - if (this.tasksQueueSize(workerNodeKey) === 0) { + if ( + this.tasksQueueSize(workerNodeKey) === 0 && + workerNode.usage.tasks.executing < + (this.opts.tasksQueueOptions?.concurrency as number) + ) { this.executeTask(workerNodeKey, task) } else { this.enqueueTask(workerNodeKey, task) -- 2.34.1