Skip to content
This repository has been archived by the owner on Dec 13, 2023. It is now read-only.

add removeWorkflowWithExpiry back to ExecutionDAOFacade #3150

Merged
merged 1 commit into from
Aug 5, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -375,6 +375,20 @@ private void removeWorkflowIndex(WorkflowModel workflow, boolean archiveWorkflow
}
}

public void removeWorkflowWithExpiry(
String workflowId, boolean archiveWorkflow, int ttlSeconds) {
try {
WorkflowModel workflow = getWorkflowModelFromDataStore(workflowId, true);

removeWorkflowIndex(workflow, archiveWorkflow);
// remove workflow from DAO with TTL
executionDAO.removeWorkflowWithExpiry(workflowId, ttlSeconds);
} catch (Exception e) {
Monitors.recordDaoError("executionDao", "removeWorkflow");
throw new TransientException("Error removing workflow: " + workflowId, e);
}
}

/**
* Reset the workflow state by removing from the {@link ExecutionDAO} and removing this workflow
* from the {@link IndexDAO}.
Expand Down