Skip to content

Commit

Permalink
fix(api): fix stop workflow run for purge, do not stop all nodes (#3223)
Browse files Browse the repository at this point in the history
Signed-off-by: Benjamin Coenen <benjamin.coenen@corp.ovh.com>
  • Loading branch information
bnjjj authored and yesnault committed Aug 20, 2018
1 parent 96d1524 commit cf2a7f7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
6 changes: 4 additions & 2 deletions engine/api/workflow/dao_run.go
Original file line number Diff line number Diff line change
Expand Up @@ -828,8 +828,10 @@ func stopRunsBlocked(db *gorp.DbMap) error {
}

stopWorkflowNodeRunStages(&nr)
nr.Status = sdk.StatusStopped.String()
nr.Done = now
if !sdk.StatusIsTerminated(resp[i].Status) {
nr.Status = sdk.StatusStopped.String()
nr.Done = now
}

if err := updateNodeRunStatusAndStage(tx, &nr); err != nil {
return sdk.WrapError(err, "stopRunsBlocked> cannot update node runs stages")
Expand Down
1 change: 1 addition & 0 deletions engine/api/workflow/process.go
Original file line number Diff line number Diff line change
Expand Up @@ -653,6 +653,7 @@ func processWorkflowNodeRun(ctx context.Context, db gorp.SqlExecutor, store cach
if err := insertWorkflowNodeRun(db, run); err != nil {
return report, true, sdk.WrapError(err, "processWorkflowNodeRun> unable to insert run (node id : %d, node name : %s, subnumber : %d)", run.WorkflowNodeID, run.WorkflowNodeName, run.SubNumber)
}
w.LastExecution = time.Now()

buildParameters := sdk.ParametersToMap(run.BuildParameters)
_, okUI := buildParameters["cds.ui.pipeline.run"]
Expand Down

0 comments on commit cf2a7f7

Please sign in to comment.