Skip to content

Commit

Permalink
Merge pull request #304 from wy-hua/terminate
Browse files Browse the repository at this point in the history
Refactor workflow termination listener call
  • Loading branch information
v1r3n authored Nov 8, 2024
2 parents 4c4b234 + 535b513 commit 3843f3e
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -630,7 +630,6 @@ public WorkflowModel terminateWorkflow(
String workflowId = workflow.getWorkflowId();
workflow.setReasonForIncompletion(reason);
executionDAOFacade.updateWorkflow(workflow);
workflowStatusListener.onWorkflowTerminatedIfEnabled(workflow);
Monitors.recordWorkflowTermination(
workflow.getWorkflowName(), workflow.getStatus(), workflow.getOwnerApp());
LOGGER.info("Workflow {} is terminated because of {}", workflowId, reason);
Expand Down Expand Up @@ -697,6 +696,7 @@ public WorkflowModel terminateWorkflow(
workflow.getWorkflowName(), workflow.getWorkflowId());

List<String> erroredTasks = cancelNonTerminalTasks(workflow);
workflowStatusListener.onWorkflowTerminatedIfEnabled(workflow);
if (!erroredTasks.isEmpty()) {
throw new NonTransientException(
String.format(
Expand Down

0 comments on commit 3843f3e

Please sign in to comment.