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:
parent
190079b7f3
commit
7ccc32744a
1 changed files with 4 additions and 0 deletions
|
@ -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),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue