mirror of
https://github.com/n8n-io/n8n.git
synced 2025-03-05 20:50:17 -08:00
improve handling of retryOf
This commit is contained in:
parent
877511c0e1
commit
81a01dde67
|
@ -6,7 +6,7 @@ export type RunningJobSummary = {
|
||||||
workflowName: string;
|
workflowName: string;
|
||||||
mode: WorkflowExecuteMode;
|
mode: WorkflowExecuteMode;
|
||||||
startedAt: Date;
|
startedAt: Date;
|
||||||
retryOf: string;
|
retryOf?: string;
|
||||||
status: ExecutionStatus;
|
status: ExecutionStatus;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -61,9 +61,7 @@ export class ActiveExecutions {
|
||||||
workflowId: executionData.workflowData.id,
|
workflowId: executionData.workflowData.id,
|
||||||
};
|
};
|
||||||
|
|
||||||
if (executionData.retryOf !== undefined) {
|
fullExecutionData.retryOf = executionData.retryOf ?? undefined;
|
||||||
fullExecutionData.retryOf = executionData.retryOf.toString();
|
|
||||||
}
|
|
||||||
|
|
||||||
const workflowId = executionData.workflowData.id;
|
const workflowId = executionData.workflowData.id;
|
||||||
if (workflowId !== undefined && isWorkflowIdValid(workflowId)) {
|
if (workflowId !== undefined && isWorkflowIdValid(workflowId)) {
|
||||||
|
@ -179,7 +177,7 @@ export class ActiveExecutions {
|
||||||
data = this.activeExecutions[id];
|
data = this.activeExecutions[id];
|
||||||
returnData.push({
|
returnData.push({
|
||||||
id,
|
id,
|
||||||
retryOf: data.executionData.retryOf,
|
retryOf: data.executionData.retryOf ?? undefined,
|
||||||
startedAt: data.startedAt,
|
startedAt: data.startedAt,
|
||||||
mode: data.executionData.executionMode,
|
mode: data.executionData.executionMode,
|
||||||
workflowId: data.executionData.workflowData.id,
|
workflowId: data.executionData.workflowData.id,
|
||||||
|
|
|
@ -582,7 +582,7 @@ export function getWorkflowHooksMain(
|
||||||
): WorkflowHooks {
|
): WorkflowHooks {
|
||||||
const { pushRef, retryOf } = data;
|
const { pushRef, retryOf } = data;
|
||||||
const saveSettings = toSaveSettings(data.workflowData.settings);
|
const saveSettings = toSaveSettings(data.workflowData.settings);
|
||||||
const optionalParameters = { pushRef, retryOf, saveSettings };
|
const optionalParameters = { pushRef, retryOf: retryOf ?? undefined, saveSettings };
|
||||||
const hookFunctions = mergeHookFunctions(
|
const hookFunctions = mergeHookFunctions(
|
||||||
hookFunctionsWorkflowEvents(),
|
hookFunctionsWorkflowEvents(),
|
||||||
hookFunctionsNodeEvents(),
|
hookFunctionsNodeEvents(),
|
||||||
|
|
|
@ -189,7 +189,7 @@ export class ExecutionRecoveryService {
|
||||||
executionMode: execution.mode,
|
executionMode: execution.mode,
|
||||||
executionData: execution.data,
|
executionData: execution.data,
|
||||||
runData: execution.data.resultData.runData,
|
runData: execution.data.resultData.runData,
|
||||||
retryOf: execution.retryOf,
|
retryOf: execution.retryOf ?? undefined,
|
||||||
},
|
},
|
||||||
execution.id,
|
execution.id,
|
||||||
);
|
);
|
||||||
|
|
|
@ -135,7 +135,7 @@ export class JobProcessor {
|
||||||
execution.mode,
|
execution.mode,
|
||||||
job.data.executionId,
|
job.data.executionId,
|
||||||
execution.workflowData,
|
execution.workflowData,
|
||||||
{ retryOf: execution.retryOf as string, pushRef },
|
{ retryOf: execution.retryOf ?? undefined, pushRef },
|
||||||
);
|
);
|
||||||
|
|
||||||
if (pushRef) {
|
if (pushRef) {
|
||||||
|
@ -229,7 +229,7 @@ export class JobProcessor {
|
||||||
workflowName: execution.workflowData.name,
|
workflowName: execution.workflowData.name,
|
||||||
mode: execution.mode,
|
mode: execution.mode,
|
||||||
startedAt,
|
startedAt,
|
||||||
retryOf: execution.retryOf ?? '',
|
retryOf: execution.retryOf ?? undefined,
|
||||||
status: execution.status,
|
status: execution.status,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -352,7 +352,7 @@ export class WorkflowRunner {
|
||||||
job = await this.scalingService.addJob(jobData, { priority: realtime ? 50 : 100 });
|
job = await this.scalingService.addJob(jobData, { priority: realtime ? 50 : 100 });
|
||||||
|
|
||||||
hooks = getWorkflowHooksWorkerMain(data.executionMode, executionId, data.workflowData, {
|
hooks = getWorkflowHooksWorkerMain(data.executionMode, executionId, data.workflowData, {
|
||||||
retryOf: data.retryOf ? data.retryOf.toString() : undefined,
|
retryOf: data.retryOf ?? undefined,
|
||||||
});
|
});
|
||||||
|
|
||||||
// Normally also workflow should be supplied here but as it only used for sending
|
// Normally also workflow should be supplied here but as it only used for sending
|
||||||
|
@ -365,7 +365,7 @@ export class WorkflowRunner {
|
||||||
data.executionMode,
|
data.executionMode,
|
||||||
executionId,
|
executionId,
|
||||||
data.workflowData,
|
data.workflowData,
|
||||||
{ retryOf: data.retryOf ? data.retryOf.toString() : undefined },
|
{ retryOf: data.retryOf ?? undefined },
|
||||||
);
|
);
|
||||||
await this.processError(error, new Date(), data.executionMode, executionId, hooks);
|
await this.processError(error, new Date(), data.executionMode, executionId, hooks);
|
||||||
throw error;
|
throw error;
|
||||||
|
@ -383,7 +383,7 @@ export class WorkflowRunner {
|
||||||
data.executionMode,
|
data.executionMode,
|
||||||
executionId,
|
executionId,
|
||||||
data.workflowData,
|
data.workflowData,
|
||||||
{ retryOf: data.retryOf ? data.retryOf.toString() : undefined },
|
{ retryOf: data.retryOf ?? undefined },
|
||||||
);
|
);
|
||||||
|
|
||||||
const error = new ExecutionCancelledError(executionId);
|
const error = new ExecutionCancelledError(executionId);
|
||||||
|
@ -408,7 +408,7 @@ export class WorkflowRunner {
|
||||||
data.executionMode,
|
data.executionMode,
|
||||||
executionId,
|
executionId,
|
||||||
data.workflowData,
|
data.workflowData,
|
||||||
{ retryOf: data.retryOf ? data.retryOf.toString() : undefined },
|
{ retryOf: data.retryOf ?? undefined },
|
||||||
);
|
);
|
||||||
|
|
||||||
await this.processError(error, new Date(), data.executionMode, executionId, hooks);
|
await this.processError(error, new Date(), data.executionMode, executionId, hooks);
|
||||||
|
|
|
@ -2284,7 +2284,7 @@ export interface IWorkflowExecutionDataProcess {
|
||||||
executionData?: IRunExecutionData;
|
executionData?: IRunExecutionData;
|
||||||
runData?: IRunData;
|
runData?: IRunData;
|
||||||
pinData?: IPinData;
|
pinData?: IPinData;
|
||||||
retryOf?: string;
|
retryOf?: string | null;
|
||||||
pushRef?: string;
|
pushRef?: string;
|
||||||
startNodes?: StartNodeData[];
|
startNodes?: StartNodeData[];
|
||||||
workflowData: IWorkflowBase;
|
workflowData: IWorkflowBase;
|
||||||
|
|
Loading…
Reference in a new issue