X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Fpools%2Fselection-strategies%2Fworker-choice-strategy-context.ts;h=e3aaaea36c4fbfaf628d4d1bea31c64bfbb0d6a3;hb=946b809b91118cd7442b90971344e53e15c26466;hp=7c7574fa7a39f55913282a60bd0becf35e88b6fc;hpb=336e91c4a22c1c67f0f1cff28dbbb18bff8d8083;p=poolifier.git diff --git a/src/pools/selection-strategies/worker-choice-strategy-context.ts b/src/pools/selection-strategies/worker-choice-strategy-context.ts index 7c7574fa..e3aaaea3 100644 --- a/src/pools/selection-strategies/worker-choice-strategy-context.ts +++ b/src/pools/selection-strategies/worker-choice-strategy-context.ts @@ -37,7 +37,7 @@ export class WorkerChoiceStrategyContext< /** * The number of times the worker choice strategy in the context has been retried. */ - private choiceRetriesCount = 0 + private retriesCount = 0 /** * Worker choice strategy context constructor. @@ -178,16 +178,16 @@ export class WorkerChoiceStrategyContext< ).choose() if ( workerNodeKey == null && - this.choiceRetriesCount < (this.opts.choiceRetries as number) + this.retriesCount < (this.opts.retries as number) ) { - this.choiceRetriesCount++ + this.retriesCount++ return this.execute() } else if (workerNodeKey == null) { throw new Error( - `Worker node key chosen is null or undefined after ${this.choiceRetriesCount} retries` + `Worker node key chosen is null or undefined after ${this.retriesCount} retries` ) } - this.choiceRetriesCount = 0 + this.retriesCount = 0 return workerNodeKey }