Skip to content

Commit 507ea4f

Browse files
committed
fix
1 parent 4174f9c commit 507ea4f

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

api/restHandler/app/pipeline/configure/BuildPipelineRestHandler.go

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1562,12 +1562,16 @@ func (handler *PipelineConfigRestHandlerImpl) CancelWorkflow(w http.ResponseWrit
15621562
return
15631563
}
15641564
var forceAbort bool
1565-
forceAbort, err = strconv.ParseBool(queryVars.Get("forceAbort"))
1566-
if err != nil {
1567-
handler.Logger.Errorw("request err, CancelWorkflow", "err", err)
1568-
common.WriteJsonResp(w, err, nil, http.StatusBadRequest)
1569-
return
1565+
forceAbortQueryParam := queryVars.Get("forceAbort")
1566+
if len(forceAbortQueryParam) > 0 {
1567+
forceAbort, err = strconv.ParseBool(forceAbortQueryParam)
1568+
if err != nil {
1569+
handler.Logger.Errorw("request err, CancelWorkflow", "err", err)
1570+
common.WriteJsonResp(w, err, nil, http.StatusBadRequest)
1571+
return
1572+
}
15701573
}
1574+
15711575
handler.Logger.Infow("request payload, CancelWorkflow", "workflowId", workflowId, "pipelineId", pipelineId)
15721576

15731577
ciPipeline, err := handler.ciPipelineRepository.FindById(pipelineId)

0 commit comments

Comments
 (0)