mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-18 02:21:13 +00:00
fix(core): Handle max stalled count error better (#12824)
This commit is contained in:
@@ -37,6 +37,8 @@ import * as WorkflowExecuteAdditionalData from '@/workflow-execute-additional-da
|
||||
import { generateFailedExecutionFromError } from '@/workflow-helpers';
|
||||
import { WorkflowStaticDataService } from '@/workflows/workflow-static-data.service';
|
||||
|
||||
import { MaxStalledCountError } from './errors/max-stalled-count.error';
|
||||
|
||||
@Service()
|
||||
export class WorkflowRunner {
|
||||
private scalingService: ScalingService;
|
||||
@@ -416,6 +418,13 @@ export class WorkflowRunner {
|
||||
try {
|
||||
await job.finished();
|
||||
} catch (error) {
|
||||
if (
|
||||
error instanceof Error &&
|
||||
error.message.includes('job stalled more than maxStalledCount')
|
||||
) {
|
||||
error = new MaxStalledCountError(error);
|
||||
}
|
||||
|
||||
// We use "getWorkflowHooksWorkerExecuter" as "getWorkflowHooksWorkerMain" does not contain the
|
||||
// "workflowExecuteAfter" which we require.
|
||||
const hooks = getWorkflowHooksWorkerExecuter(
|
||||
@@ -424,6 +433,7 @@ export class WorkflowRunner {
|
||||
data.workflowData,
|
||||
{ retryOf: data.retryOf ? data.retryOf.toString() : undefined },
|
||||
);
|
||||
|
||||
await this.processError(error, new Date(), data.executionMode, executionId, hooks);
|
||||
|
||||
reject(error);
|
||||
|
||||
Reference in New Issue
Block a user