Remove WaitingApproval for stopped tasks

This commit is contained in:
Carlo Mandelli 2021-02-03 19:45:27 +01:00
parent c3c18e0d2c
commit 45eb092871
1 changed files with 3 additions and 0 deletions

View File

@ -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) return errors.Errorf("run %s is not running but in %q phase", r.ID, r.Phase)
} }
r.Stop = true r.Stop = true
for _, t := range r.TasksWaitingApproval() {
r.Tasks[t].WaitingApproval = false
}
_, err = store.AtomicPutRun(ctx, h.e, r, nil, cgt) _, err = store.AtomicPutRun(ctx, h.e, r, nil, cgt)
return err return err