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; workflowName: string;
mode: WorkflowExecuteMode; mode: WorkflowExecuteMode;
startedAt: Date; startedAt: Date;
retryOf: string; retryOf?: string;
status: ExecutionStatus; status: ExecutionStatus;
}; };

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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