perf: remove unneeded condition in tasks stealing code
authorJérôme Benoit <jerome.benoit@piment-noir.org>
Sat, 26 Aug 2023 23:36:47 +0000 (01:36 +0200)
committerJérôme Benoit <jerome.benoit@piment-noir.org>
Sat, 26 Aug 2023 23:36:47 +0000 (01:36 +0200)
Signed-off-by: Jérôme Benoit <jerome.benoit@piment-noir.org>
src/pools/abstract-pool.ts

index f862bbbecfff8c4068c7243e362035470f00b392..2f5c61896658311c96c551deee3fb99552273be2 100644 (file)
@@ -1302,11 +1302,7 @@ export abstract class AbstractPool<
           ...(sourceWorkerNode.popTask() as Task<Data>),
           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)