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