perf: remove unneeded decrement in condition
authorJérôme Benoit <jerome.benoit@sap.com>
Tue, 11 Apr 2023 06:19:05 +0000 (08:19 +0200)
committerJérôme Benoit <jerome.benoit@sap.com>
Tue, 11 Apr 2023 06:19:05 +0000 (08:19 +0200)
Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
src/pools/abstract-pool.ts

index 99f65a24a0ee85f606ab7937653cf0b641472bc8..3f6e7034f4c6994d4177038cd5c89bf1f3b26636 100644 (file)
@@ -258,10 +258,9 @@ export abstract class AbstractPool<
     if (
       this.opts.enableTasksQueue === true &&
       (this.busy ||
-        this.workerNodes[workerNodeKey].tasksUsage.running >
+        this.workerNodes[workerNodeKey].tasksUsage.running >=
           ((this.opts.tasksQueueOptions as TasksQueueOptions)
-            .concurrency as number) -
-            1)
+            .concurrency as number))
     ) {
       this.enqueueTask(workerNodeKey, submittedTask)
     } else {