Skip to content

Commit

Permalink
fix(pipelines): Do not change status to CANCELED if pipeline executio…
Browse files Browse the repository at this point in the history
…n has already completed. (#217)
  • Loading branch information
Matt Duftler committed Jan 26, 2018
1 parent 0509d58 commit 80c8529
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,13 @@ List<ExecutionLogEntry> logs(@PathVariable String executionId) {
void cancel(@PathVariable String executionId) {
log.info("Cancelling pipeline execution {}...", executionId);

Execution pipeline = executionRepository.retrieve(Execution.ExecutionType.PIPELINE, executionId);

if (pipeline.getStatus().isComplete()) {
log.debug("Not changing status of pipeline execution {} to CANCELED since execution is already completed: {}", executionId, pipeline.getStatus());
return;
}

executionRepository.cancel(executionId);
executionRepository.updateStatus(executionId, ExecutionStatus.CANCELED);
}
Expand Down

0 comments on commit 80c8529

Please sign in to comment.