Skip to content

Commit 6080ec9

Browse files
committed
check put for force abort
1 parent 34bea34 commit 6080ec9

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

pkg/pipeline/CiHandler.go

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -630,10 +630,13 @@ func (impl *CiHandlerImpl) CancelBuild(workflowId int, forceAbort bool) (int, er
630630
impl.Logger.Errorw("cannot terminate wf", "err", err)
631631
return 0, err
632632
}
633-
err = impl.handleForceAbortCase(workflow, forceAbort)
634-
if err != nil {
635-
impl.Logger.Errorw("error in handleForceAbortCase", "forceAbortFlag", forceAbort, "workflow", workflow, "err", err)
636-
return 0, err
633+
if forceAbort {
634+
err = impl.handleForceAbortCase(workflow, forceAbort)
635+
if err != nil {
636+
impl.Logger.Errorw("error in handleForceAbortCase", "forceAbortFlag", forceAbort, "workflow", workflow, "err", err)
637+
return 0, err
638+
}
639+
return workflow.Id, nil
637640
}
638641

639642
workflow.Status = executors.WorkflowCancel

0 commit comments

Comments
 (0)