1
0
Fork 0
mirror of https://code.forgejo.org/forgejo/runner.git synced 2025-09-15 18:57:01 +00:00

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).
This commit is contained in:
Earl Warren 2025-07-05 10:43:24 +02:00
parent 190079b7f3
commit 7ccc32744a
No known key found for this signature in database
GPG key ID: 0579CB2928A78A00

View file

@ -264,6 +264,10 @@ func (r *Reporter) ReportLog(noMore bool) error {
rows := r.logRows rows := r.logRows
r.stateMu.RUnlock() r.stateMu.RUnlock()
if len(rows) == 0 {
return nil
}
resp, err := r.client.UpdateLog(r.ctx, connect.NewRequest(&runnerv1.UpdateLogRequest{ resp, err := r.client.UpdateLog(r.ctx, connect.NewRequest(&runnerv1.UpdateLogRequest{
TaskId: r.state.Id, TaskId: r.state.Id,
Index: int64(r.logOffset), Index: int64(r.logOffset),