From 5ea80606520ed06f815f4f7485ec9057ac23b176 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Fri, 16 Jun 2023 22:46:08 +0200 Subject: [PATCH] refactor: silence sonar MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit --- .../selection-strategies/least-busy-worker-choice-strategy.ts | 2 +- .../selection-strategies/least-elu-worker-choice-strategy.ts | 2 +- .../selection-strategies/least-used-worker-choice-strategy.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) 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 -- 2.34.1