From 8b80810a81554f0e6442dd681e68f59fdfd23312 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Sun, 27 Aug 2023 01:36:47 +0200 Subject: [PATCH] perf: remove unneeded condition in tasks stealing code 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, 1 insertion(+), 5 deletions(-) diff --git a/src/pools/abstract-pool.ts b/src/pools/abstract-pool.ts index f862bbbe..2f5c6189 100644 --- a/src/pools/abstract-pool.ts +++ b/src/pools/abstract-pool.ts @@ -1302,11 +1302,7 @@ export abstract class AbstractPool< ...(sourceWorkerNode.popTask() as Task), workerId: workerNode.info.id as number } - if ( - this.tasksQueueSize(workerNodeKey) === 0 && - workerNode.usage.tasks.executing < - (this.opts.tasksQueueOptions?.concurrency as number) - ) { + if (this.tasksQueueSize(workerNodeKey) === 0) { this.executeTask(workerNodeKey, task) } else { this.enqueueTask(workerNodeKey, task) -- 2.34.1