mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 18:12:04 +00:00
refactor(core): Provide clearer errors on task runner rejection (#14666)
This commit is contained in:
@@ -258,17 +258,20 @@ export abstract class TaskRunner extends EventEmitter {
|
||||
request.resolve(nodeTypes);
|
||||
}
|
||||
|
||||
hasOpenTasks() {
|
||||
/**
|
||||
* Whether the task runner has capacity to accept more tasks.
|
||||
*/
|
||||
hasOpenTaskSlots() {
|
||||
return this.runningTasks.size < this.maxConcurrency;
|
||||
}
|
||||
|
||||
offerAccepted(offerId: string, taskId: string) {
|
||||
if (!this.hasOpenTasks()) {
|
||||
if (!this.hasOpenTaskSlots()) {
|
||||
this.openOffers.delete(offerId);
|
||||
this.send({
|
||||
type: 'runner:taskrejected',
|
||||
taskId,
|
||||
reason: 'No open task slots',
|
||||
reason: 'No open task slots - runner already at capacity',
|
||||
});
|
||||
return;
|
||||
}
|
||||
@@ -278,7 +281,7 @@ export abstract class TaskRunner extends EventEmitter {
|
||||
this.send({
|
||||
type: 'runner:taskrejected',
|
||||
taskId,
|
||||
reason: 'Offer expired and no open task slots',
|
||||
reason: 'Offer expired - not accepted within validity window',
|
||||
});
|
||||
return;
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user