refactor: silence sonar
authorJérôme Benoit <jerome.benoit@sap.com>
Fri, 16 Jun 2023 20:46:08 +0000 (22:46 +0200)
committerJérôme Benoit <jerome.benoit@sap.com>
Fri, 16 Jun 2023 20:46:08 +0000 (22:46 +0200)
Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
src/pools/selection-strategies/least-busy-worker-choice-strategy.ts
src/pools/selection-strategies/least-elu-worker-choice-strategy.ts
src/pools/selection-strategies/least-used-worker-choice-strategy.ts

index dc304c89fd1e5abecb680aa5d519d9a59f6f18ac..aafc07dd6f8ac8f8faa47742bdda2e096449fd55 100644 (file)
@@ -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
index eca5a1cf541eca5d25102cacf821a08b556ad894..5df742a665d5d9b5ed838beb887e426da43ade07 100644 (file)
@@ -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
index a505e6270aea7f19c458d1872aa2f69fe6b190cb..922659d33e6947e08e12df7b3bf0cd64dd55bf7a 100644 (file)
@@ -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