Fix reporting log in Reporter.Close (#126)

Previously, the `Close` func returns incorrectly so that the logs may not be reported.

This PR fixes the incorrect return and sets the `StoppedAt` to get the correct task duration.

Reviewed-on: https://gitea.com/gitea/act_runner/pulls/126
Reviewed-by: Jason Song <i@wolfogre.com>
Co-authored-by: Zettat123 <zettat123@gmail.com>
Co-committed-by: Zettat123 <zettat123@gmail.com>
This commit is contained in:
Zettat123 2023-04-19 11:17:49 +08:00 committed by Jason Song
parent c69c353d93
commit bc6031eff7

View File

@ -184,7 +184,7 @@ func (r *Reporter) Close(lastWords string) error {
Time: timestamppb.Now(),
Content: lastWords,
})
return nil
r.state.StoppedAt = timestamppb.Now()
} else if lastWords != "" {
r.logRows = append(r.logRows, &runnerv1.LogRow{
Time: timestamppb.Now(),