From bc6031eff72b71eba13b266c0dd4f083563dcbca Mon Sep 17 00:00:00 2001 From: Zettat123 Date: Wed, 19 Apr 2023 11:17:49 +0800 Subject: [PATCH] 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 Co-authored-by: Zettat123 Co-committed-by: Zettat123 --- internal/pkg/report/reporter.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/pkg/report/reporter.go b/internal/pkg/report/reporter.go index e6b635a..72b0e1d 100644 --- a/internal/pkg/report/reporter.go +++ b/internal/pkg/report/reporter.go @@ -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(),