Merge pull request #57 from sgotti/runservice_stop_also_if_result_is_not_set

runservice: stop run also if result is not set
This commit is contained in:
Simone Gotti 2019-07-23 15:09:58 +02:00 committed by GitHub
commit 19706fe485
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 4 deletions

View File

@ -120,10 +120,7 @@ func (h *ActionHandler) StopRun(ctx context.Context, req *RunStopRequest) error
if r.Phase != types.RunPhaseRunning { if r.Phase != types.RunPhaseRunning {
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)
} }
if !r.Result.IsSet() {
// stop only if the result is not setted yet
r.Stop = true r.Stop = true
}
_, err = store.AtomicPutRun(ctx, h.e, r, nil, cgt) _, err = store.AtomicPutRun(ctx, h.e, r, nil, cgt)
return err return err