Skip to content

Commit

Permalink
Merge pull request agola-io#253 from camandel/remove_waitapprove_if_s…
Browse files Browse the repository at this point in the history
…topped

Remove WaitingApproval for stopped tasks
  • Loading branch information
sgotti authored Feb 8, 2021
2 parents ded2f33 + 51ab1f1 commit 204a680
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions internal/services/runservice/action/action.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,9 @@ func (h *ActionHandler) StopRun(ctx context.Context, req *RunStopRequest) error
return errors.Errorf("run %s is not running but in %q phase", r.ID, r.Phase)
}
r.Stop = true
for _, t := range r.TasksWaitingApproval() {
r.Tasks[t].WaitingApproval = false
}

_, err = store.AtomicPutRun(ctx, h.e, r, nil, cgt)
return err
Expand Down

0 comments on commit 204a680

Please sign in to comment.