From: Jérôme Benoit Date: Mon, 10 Apr 2023 04:07:04 +0000 (+0200) Subject: perf: optimize fixed pool busyness detection X-Git-Tag: v2.4.6~6 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=249900794cc90e66d180fb43e59937e89a50fb65;p=poolifier.git perf: optimize fixed pool busyness detection Signed-off-by: Jérôme Benoit --- diff --git a/src/pools/abstract-pool.ts b/src/pools/abstract-pool.ts index 661eb7b6..1a1a89fb 100644 --- a/src/pools/abstract-pool.ts +++ b/src/pools/abstract-pool.ts @@ -214,10 +214,7 @@ export abstract class AbstractPool< public abstract get busy (): boolean protected internalBusy (): boolean { - return ( - this.numberOfRunningTasks >= this.numberOfWorkers && - this.findFreeWorkerNodeKey() === -1 - ) + return this.findFreeWorkerNodeKey() === -1 } /** @inheritDoc */