From: Jérôme Benoit Date: Fri, 16 Jun 2023 20:46:08 +0000 (+0200) Subject: refactor: silence sonar X-Git-Tag: v2.6.3~15 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=5ea80606520ed06f815f4f7485ec9057ac23b176;p=poolifier.git refactor: silence sonar Signed-off-by: Jérôme Benoit --- diff --git a/src/pools/selection-strategies/least-busy-worker-choice-strategy.ts b/src/pools/selection-strategies/least-busy-worker-choice-strategy.ts index dc304c89..aafc07dd 100644 --- a/src/pools/selection-strategies/least-busy-worker-choice-strategy.ts +++ b/src/pools/selection-strategies/least-busy-worker-choice-strategy.ts @@ -64,7 +64,7 @@ export class LeastBusyWorkerChoiceStrategy< workerNode.workerUsage.waitTime.aggregate if (workerTime === 0) { this.nextWorkerNodeId = workerNodeKey - return true + break } else if (workerTime < minTime) { minTime = workerTime this.nextWorkerNodeId = workerNodeKey diff --git a/src/pools/selection-strategies/least-elu-worker-choice-strategy.ts b/src/pools/selection-strategies/least-elu-worker-choice-strategy.ts index eca5a1cf..5df742a6 100644 --- a/src/pools/selection-strategies/least-elu-worker-choice-strategy.ts +++ b/src/pools/selection-strategies/least-elu-worker-choice-strategy.ts @@ -63,7 +63,7 @@ export class LeastEluWorkerChoiceStrategy< const workerElu = workerUsage.elu?.active.aggregate ?? 0 if (workerElu === 0) { this.nextWorkerNodeId = workerNodeKey - return true + break } else if (workerElu < minWorkerElu) { minWorkerElu = workerElu this.nextWorkerNodeId = workerNodeKey diff --git a/src/pools/selection-strategies/least-used-worker-choice-strategy.ts b/src/pools/selection-strategies/least-used-worker-choice-strategy.ts index a505e627..922659d3 100644 --- a/src/pools/selection-strategies/least-used-worker-choice-strategy.ts +++ b/src/pools/selection-strategies/least-used-worker-choice-strategy.ts @@ -46,7 +46,7 @@ export class LeastUsedWorkerChoiceStrategy< workerTaskStatistics.queued if (workerTasks === 0) { this.nextWorkerNodeId = workerNodeKey - return true + break } else if (workerTasks < minNumberOfTasks) { minNumberOfTasks = workerTasks this.nextWorkerNodeId = workerNodeKey