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/http-server-pool/fastify-worker_thr...
[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 a3e3379c9ac461fc7cd16c2d32bb8735ca2d50ff..e3aaaea36c4fbfaf628d4d1bea31c64bfbb0d6a3 100644
(file)
--- 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.
*/
/**
* The number of times the worker choice strategy in the context has been retried.
*/
- private
choiceR
etriesCount = 0
+ private
r
etriesCount = 0
/**
* Worker choice strategy context constructor.
/**
* Worker choice strategy context constructor.
@@
-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 = (
@@
-178,16
+178,16
@@
export class WorkerChoiceStrategyContext<
).choose()
if (
workerNodeKey == null &&
).choose()
if (
workerNodeKey == null &&
- this.
choiceRetriesCount < (this.opts.choiceR
etries as number)
+ this.
retriesCount < (this.opts.r
etries as number)
) {
) {
- this.
choiceR
etriesCount++
+ this.
r
etriesCount++
return this.execute()
} else if (workerNodeKey == null) {
return this.execute()
} else if (workerNodeKey == null) {
- throw new
Type
Error(
- `Worker node key chosen is null or undefined after ${this.
choiceR
etriesCount} retries`
+ throw new Error(
+ `Worker node key chosen is null or undefined after ${this.
r
etriesCount} retries`
)
}
)
}
- this.
choiceR
etriesCount = 0
+ this.
r
etriesCount = 0
return workerNodeKey
}
return workerNodeKey
}