ready: this.ready,
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
strategy: this.opts.workerChoiceStrategy!,
+ strategyRetries: this.workerChoiceStrategyContext?.retriesCount ?? 0,
minSize: this.minimumNumberOfWorkers,
maxSize: this.maximumNumberOfWorkers ?? this.minimumNumberOfWorkers,
...(this.workerChoiceStrategyContext?.getTaskStatisticsRequirements()
- ?.runTime.aggregate === true &&
+ .runTime.aggregate === true &&
this.workerChoiceStrategyContext.getTaskStatisticsRequirements()
.waitTime.aggregate && {
utilization: round(this.utilization)
0
),
...(this.workerChoiceStrategyContext?.getTaskStatisticsRequirements()
- ?.runTime.aggregate === true && {
+ .runTime.aggregate === true && {
runTime: {
minimum: round(
min(
}
}),
...(this.workerChoiceStrategyContext?.getTaskStatisticsRequirements()
- ?.waitTime.aggregate === true && {
+ .waitTime.aggregate === true && {
waitTime: {
minimum: round(
min(
statistics: {
runTime:
this.workerChoiceStrategyContext?.getTaskStatisticsRequirements()
- ?.runTime.aggregate ?? false,
+ .runTime.aggregate ?? false,
elu:
- this.workerChoiceStrategyContext?.getTaskStatisticsRequirements()?.elu
+ this.workerChoiceStrategyContext?.getTaskStatisticsRequirements().elu
.aggregate ?? false
}
})
) {
workerInfo.stealing = false
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
- for (const taskName of this.workerNodes[workerNodeKey].info
- .taskFunctionNames!) {
+ for (const taskName of workerInfo.taskFunctionNames!) {
this.resetTaskSequentiallyStolenStatisticsTaskFunctionWorkerUsage(
workerNodeKey,
taskName
this.promiseResponseMap.delete(taskId!)
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
workerNode?.emit('taskFinished', taskId)
- if (this.opts.enableTasksQueue === true && !this.destroying) {
+ if (
+ this.opts.enableTasksQueue === true &&
+ !this.destroying &&
+ // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
+ workerNode != null
+ ) {
const workerNodeTasksUsage = workerNode.usage.tasks
if (
this.tasksQueueSize(workerNodeKey) > 0 &&