X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;ds=inline;f=src%2Fpools%2Fselection-strategies%2Fabstract-worker-choice-strategy.ts;h=68e09238b204c35e4f6bb87392021f314e3e2923;hb=daa30e0e21087d1a3cf24b3dd38f703b1aba6d46;hp=5ec7cedc0f9dc0f2f4a1079302a94d515c5d4281;hpb=b7e141c40bccfd7a4ec0ff98b7829f7d296f048b;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 5ec7cedc..68e09238 100644 --- a/src/pools/selection-strategies/abstract-worker-choice-strategy.ts +++ b/src/pools/selection-strategies/abstract-worker-choice-strategy.ts @@ -123,7 +123,7 @@ export abstract class AbstractWorkerChoiceStrategy< * @returns Whether the worker node is ready or not. */ private isWorkerNodeReady (workerNodeKey: number): boolean { - return this.pool.workerNodes[workerNodeKey].info.ready + return this.pool.workerNodes[workerNodeKey]?.info.ready } /** @@ -208,7 +208,7 @@ export abstract class AbstractWorkerChoiceStrategy< */ protected checkNextWorkerNodeEligibility (): void { if (!this.isWorkerNodeEligible(this.nextWorkerNodeKey as number)) { - this.nextWorkerNodeKey = undefined + delete this.nextWorkerNodeKey } }