repositories
/
poolifier.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge dependabot/npm_and_yarn/examples/typescript/smtp-client-pool/poolifier-2.6...
[poolifier.git]
/
src
/
pools
/
selection-strategies
/
worker-choice-strategy-context.ts
diff --git
a/src/pools/selection-strategies/worker-choice-strategy-context.ts
b/src/pools/selection-strategies/worker-choice-strategy-context.ts
index 8c5a9587debbd4b66fba9a7630838fcc44cabc3c..7c7574fa7a39f55913282a60bd0becf35e88b6fc 100644
(file)
--- a/
src/pools/selection-strategies/worker-choice-strategy-context.ts
+++ b/
src/pools/selection-strategies/worker-choice-strategy-context.ts
@@
-168,7
+168,7
@@
export class WorkerChoiceStrategyContext<
* Executes the worker choice strategy in the context algorithm.
*
* @returns The key of the worker node.
* Executes the worker choice strategy in the context algorithm.
*
* @returns The key of the worker node.
- * @throws {@link https://nodejs.org/api/errors.html#class-error} If
the worker node key is null or undefined
.
+ * @throws {@link https://nodejs.org/api/errors.html#class-error} If
after configured retries the worker node key is null or undefined
.
*/
public execute (): number {
const workerNodeKey = (
*/
public execute (): number {
const workerNodeKey = (
@@
-183,8
+183,11
@@
export class WorkerChoiceStrategyContext<
this.choiceRetriesCount++
return this.execute()
} else if (workerNodeKey == null) {
this.choiceRetriesCount++
return this.execute()
} else if (workerNodeKey == null) {
- throw new TypeError('Worker node key chosen is null or undefined')
+ throw new Error(
+ `Worker node key chosen is null or undefined after ${this.choiceRetriesCount} retries`
+ )
}
}
+ this.choiceRetriesCount = 0
return workerNodeKey
}
return workerNodeKey
}