this.opts.enableTasksQueue === true &&
(this.busy ||
this.workerNodes[workerNodeKey].usage.tasks.executing >=
- ((this.opts.tasksQueueOptions as TasksQueueOptions)
- .concurrency as number))
+ (this.opts.tasksQueueOptions?.concurrency as number))
) {
this.enqueueTask(workerNodeKey, task)
} else {
}
})
const workerInfo = this.getWorkerInfo(workerNodeKey)
- workerInfo.dynamic = true
- if (this.workerChoiceStrategyContext.getStrategyPolicy().useDynamicWorker) {
- workerInfo.ready = true
- }
this.sendToWorker(workerNodeKey, {
checkActive: true,
workerId: workerInfo.id as number
})
+ workerInfo.dynamic = true
+ if (this.workerChoiceStrategyContext.getStrategyPolicy().useDynamicWorker) {
+ workerInfo.ready = true
+ }
return workerNodeKey
}
this.promiseResponseMap.delete(message.id as string)
if (
this.opts.enableTasksQueue === true &&
- this.tasksQueueSize(workerNodeKey) > 0
+ this.tasksQueueSize(workerNodeKey) > 0 &&
+ this.workerNodes[workerNodeKey].usage.tasks.executing <
+ (this.opts.tasksQueueOptions?.concurrency as number)
) {
this.executeTask(
workerNodeKey,