repositories
/
poolifier.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
build: update volta node.js version
[poolifier.git]
/
src
/
pools
/
selection-strategies
/
least-busy-worker-choice-strategy.ts
diff --git
a/src/pools/selection-strategies/least-busy-worker-choice-strategy.ts
b/src/pools/selection-strategies/least-busy-worker-choice-strategy.ts
index dc304c89fd1e5abecb680aa5d519d9a59f6f18ac..84476eedaf0c434f5bcce23aa7ca694f1bf9d267 100644
(file)
--- a/
src/pools/selection-strategies/least-busy-worker-choice-strategy.ts
+++ b/
src/pools/selection-strategies/least-busy-worker-choice-strategy.ts
@@
-57,6
+57,11
@@
export class LeastBusyWorkerChoiceStrategy<
/** @inheritDoc */
public update (): boolean {
/** @inheritDoc */
public update (): boolean {
+ return true
+ }
+
+ /** @inheritDoc */
+ public choose (): number {
let minTime = Infinity
for (const [workerNodeKey, workerNode] of this.pool.workerNodes.entries()) {
const workerTime =
let minTime = Infinity
for (const [workerNodeKey, workerNode] of this.pool.workerNodes.entries()) {
const workerTime =
@@
-64,17
+69,12
@@
export class LeastBusyWorkerChoiceStrategy<
workerNode.workerUsage.waitTime.aggregate
if (workerTime === 0) {
this.nextWorkerNodeId = workerNodeKey
workerNode.workerUsage.waitTime.aggregate
if (workerTime === 0) {
this.nextWorkerNodeId = workerNodeKey
- return true
+ break
} else if (workerTime < minTime) {
minTime = workerTime
this.nextWorkerNodeId = workerNodeKey
}
}
} else if (workerTime < minTime) {
minTime = workerTime
this.nextWorkerNodeId = workerNodeKey
}
}
- return true
- }
-
- /** @inheritDoc */
- public choose (): number {
return this.nextWorkerNodeId
}
return this.nextWorkerNodeId
}