improve handling of retryOf

This commit is contained in:
कारतोफ्फेलस्क्रिप्ट™ 2025-01-30 15:53:57 +01:00
parent 877511c0e1
commit 81a01dde67
No known key found for this signature in database
7 changed files with 12 additions and 14 deletions

View file

@ -6,7 +6,7 @@ export type RunningJobSummary = {
workflowName: string;
mode: WorkflowExecuteMode;
startedAt: Date;
retryOf: string;
retryOf?: string;
status: ExecutionStatus;
};

View file

@ -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,

View file

@ -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(),

View file

@ -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,
);

View file

@ -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,
};

View file

@ -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);

View file

@ -2284,7 +2284,7 @@ export interface IWorkflowExecutionDataProcess {
executionData?: IRunExecutionData;
runData?: IRunData;
pinData?: IPinData;
retryOf?: string;
retryOf?: string | null;
pushRef?: string;
startNodes?: StartNodeData[];
workflowData: IWorkflowBase;