Skip to content

Commit

Permalink
errors during updating the execution in the DB should not trigger the…
Browse files Browse the repository at this point in the history
… errorWorkflow
  • Loading branch information
netroy committed Jan 23, 2025
1 parent bfde154 commit 64c7982
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 36 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -349,15 +349,6 @@ describe('Execution Lifecycle Hooks', () => {
);
});

it('should handle errors when updating execution', async () => {
const error = new Error('Failed to update execution');
executionRepository.updateExistingExecution.mockRejectedValueOnce(error);

await hooks.executeHookFunctions('workflowExecuteAfter', [successfulRun, {}]);

expect(errorReporter.error).toHaveBeenCalledWith(error);
});

it('should not delete unfinished executions', async () => {
const unfinishedRun = mock<IRun>({ finished: false, status: 'running' });

Expand Down
27 changes: 0 additions & 27 deletions packages/cli/src/execution-lifecycle/execution-lifecycle-hooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -322,23 +322,6 @@ function hookFunctionsSave(): IWorkflowExecuteHooks {
executionData: fullExecutionData,
});

if (!isManualMode) {
executeErrorWorkflow(
this.workflowData,
fullRunData,
this.mode,
this.executionId,
this.retryOf,
);
}
} catch (error) {
Container.get(ErrorReporter).error(error);
logger.error(`Failed saving execution data to DB on execution ID ${this.executionId}`, {
executionId: this.executionId,
workflowId: this.workflowData.id,
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
error,
});
if (!isManualMode) {
executeErrorWorkflow(
this.workflowData,
Expand Down Expand Up @@ -440,16 +423,6 @@ function hookFunctionsSaveWorker(): IWorkflowExecuteHooks {
workflowId: this.workflowData.id,
executionData: fullExecutionData,
});
} catch (error) {
if (!isManualMode) {
executeErrorWorkflow(
this.workflowData,
fullRunData,
this.mode,
this.executionId,
this.retryOf,
);
}
} finally {
workflowStatisticsService.emit('workflowExecutionCompleted', {
workflowData: this.workflowData,
Expand Down

0 comments on commit 64c7982

Please sign in to comment.