X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Fpools%2Fselection-strategies%2Fleast-elu-worker-choice-strategy.ts;h=2ad4e90d965bb3aec2b372e417a052a4c13f43ed;hb=0bc53e954d6d832092db4ea6ccea8b0f8f071ebe;hp=0fe9cbec0275513ee8d6feed443915cf77536f07;hpb=46b0bb099fa5f4d822c5f271d24b4e9858c5b807;p=poolifier.git 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 0fe9cbec..2ad4e90d 100644 --- a/src/pools/selection-strategies/least-elu-worker-choice-strategy.ts +++ b/src/pools/selection-strategies/least-elu-worker-choice-strategy.ts @@ -70,8 +70,9 @@ export class LeastEluWorkerChoiceStrategy< private leastEluNextWorkerNodeKey (): number | undefined { return this.pool.workerNodes.reduce( (minWorkerNodeKey, workerNode, workerNodeKey, workerNodes) => { - return (workerNode.usage.elu.active.aggregate ?? 0) < - (workerNodes[minWorkerNodeKey].usage.elu.active.aggregate ?? 0) + return this.isWorkerNodeReady(workerNodeKey) && + (workerNode.usage.elu.active.aggregate ?? 0) < + (workerNodes[minWorkerNodeKey].usage.elu.active.aggregate ?? 0) ? workerNodeKey : minWorkerNodeKey },