repositories
/
poolifier.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
feat: add support for tasks ELU in fair share strategy
[poolifier.git]
/
src
/
pools
/
selection-strategies
/
least-used-worker-choice-strategy.ts
diff --git
a/src/pools/selection-strategies/least-used-worker-choice-strategy.ts
b/src/pools/selection-strategies/least-used-worker-choice-strategy.ts
index ee7834a6dc1bb12aeff39f25abf1f2b17f8dca49..4161a1d266634518c5800d57a421acb46b690fe6 100644
(file)
--- a/
src/pools/selection-strategies/least-used-worker-choice-strategy.ts
+++ b/
src/pools/selection-strategies/least-used-worker-choice-strategy.ts
@@
-27,7
+27,7
@@
export class LeastUsedWorkerChoiceStrategy<
opts: WorkerChoiceStrategyOptions = DEFAULT_WORKER_CHOICE_STRATEGY_OPTIONS
) {
super(pool, opts)
opts: WorkerChoiceStrategyOptions = DEFAULT_WORKER_CHOICE_STRATEGY_OPTIONS
) {
super(pool, opts)
- this.setTaskStatistics(this.opts)
+ this.setTaskStatistics
Requirements
(this.opts)
}
/** @inheritDoc */
}
/** @inheritDoc */
@@
-51,7
+51,9
@@
export class LeastUsedWorkerChoiceStrategy<
for (const [workerNodeKey, workerNode] of this.pool.workerNodes.entries()) {
const workerTaskStatistics = workerNode.workerUsage.tasks
const workerTasks =
for (const [workerNodeKey, workerNode] of this.pool.workerNodes.entries()) {
const workerTaskStatistics = workerNode.workerUsage.tasks
const workerTasks =
- workerTaskStatistics.executed + workerTaskStatistics.executing
+ workerTaskStatistics.executed +
+ workerTaskStatistics.executing +
+ workerTaskStatistics.queued
if (workerTasks === 0) {
return workerNodeKey
} else if (workerTasks < minNumberOfTasks) {
if (workerTasks === 0) {
return workerNodeKey
} else if (workerTasks < minNumberOfTasks) {