From 7ccc32744a46c880e26706fc86952d873d700fd6 Mon Sep 17 00:00:00 2001 From: Earl Warren Date: Sat, 5 Jul 2025 10:43:24 +0200 Subject: [PATCH] fix: ReportLog must do nothing if there is nothing to send It saves a call to the Forgejo server when no new row was added in within the interval to report the logs (1s by default). --- internal/pkg/report/reporter.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/internal/pkg/report/reporter.go b/internal/pkg/report/reporter.go index 11f00d99..d8de5127 100644 --- a/internal/pkg/report/reporter.go +++ b/internal/pkg/report/reporter.go @@ -264,6 +264,10 @@ func (r *Reporter) ReportLog(noMore bool) error { rows := r.logRows r.stateMu.RUnlock() + if len(rows) == 0 { + return nil + } + resp, err := r.client.UpdateLog(r.ctx, connect.NewRequest(&runnerv1.UpdateLogRequest{ TaskId: r.state.Id, Index: int64(r.logOffset),