mirror of https://code.forgejo.org/forgejo/runner
fix(runner): check task state field exist.
Signed-off-by: Bo-Yi.Wu <appleboy.tw@gmail.com>pull/2/head
parent
08c94bb564
commit
2442cdd8ad
|
@ -224,12 +224,15 @@ func (r *Reporter) ReportState() error {
|
||||||
resp, err := r.client.UpdateTask(r.ctx, connect.NewRequest(&runnerv1.UpdateTaskRequest{
|
resp, err := r.client.UpdateTask(r.ctx, connect.NewRequest(&runnerv1.UpdateTaskRequest{
|
||||||
State: state,
|
State: state,
|
||||||
}))
|
}))
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
if resp.Msg.State.Result == runnerv1.Result_RESULT_CANCELLED {
|
if resp.Msg.State != nil && resp.Msg.State.Result == runnerv1.Result_RESULT_CANCELLED {
|
||||||
r.cancel()
|
r.cancel()
|
||||||
}
|
}
|
||||||
|
|
||||||
return err
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (r *Reporter) duringSteps() bool {
|
func (r *Reporter) duringSteps() bool {
|
||||||
|
|
Loading…
Reference in New Issue