Merge pull request #253 from camandel/remove_waitapprove_if_stopped

Remove WaitingApproval for stopped tasks
This commit is contained in:
Simone Gotti 2021-02-08 10:27:49 +01:00 committed by GitHub
commit 097caaf871
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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)
}
r.Stop = true
for _, t := range r.TasksWaitingApproval() {
r.Tasks[t].WaitingApproval = false
}
_, err = store.AtomicPutRun(ctx, h.e, r, nil, cgt)
return err