X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Fpools%2Fselection-strategies%2Fabstract-worker-choice-strategy.ts;h=cc38d196941e4611af2235a84899cd82ab55c9f0;hb=0676e5d32c8f8ee5c5b7f5998f4973b0a276460f;hp=fb3bf707386f8bdb2bb9aac23ccf6db9d851ac96;hpb=f6bc9f26d8a0246bbee14b2b03d0bcc41b8aeb52;p=poolifier.git diff --git a/src/pools/selection-strategies/abstract-worker-choice-strategy.ts b/src/pools/selection-strategies/abstract-worker-choice-strategy.ts index fb3bf707..cc38d196 100644 --- a/src/pools/selection-strategies/abstract-worker-choice-strategy.ts +++ b/src/pools/selection-strategies/abstract-worker-choice-strategy.ts @@ -204,6 +204,16 @@ export abstract class AbstractWorkerChoiceStrategy< } } + protected checkNextWorkerNodeEligibility ( + chosenWorkerNodeKey: number | undefined + ): void { + if (!this.isWorkerNodeEligible(this.nextWorkerNodeKey as number)) { + this.nextWorkerNodeKey = undefined + this.previousWorkerNodeKey = + chosenWorkerNodeKey ?? this.previousWorkerNodeKey + } + } + protected computeDefaultWorkerWeight (): number { let cpusCycleTimeWeight = 0 for (const cpu of cpus()) {