mirror of
https://gitea.com/gitea/act_runner.git
synced 2026-03-25 16:25:02 +01:00
Compare commits
3 Commits
f4b8e7605c
...
49e6324e5c
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
49e6324e5c | ||
|
|
9ab05e3d6a | ||
|
|
6d2ce82645 |
@@ -5,6 +5,7 @@ package report
|
||||
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"fmt"
|
||||
"regexp"
|
||||
"strings"
|
||||
@@ -263,12 +264,15 @@ func (r *Reporter) Close(lastWords string) error {
|
||||
log.Error("No Response from RunDaemon for 60s, continue best effort")
|
||||
}
|
||||
|
||||
return retry.Do(func() error {
|
||||
if err := r.ReportLog(true); err != nil {
|
||||
return err
|
||||
}
|
||||
return r.ReportState(true)
|
||||
}, retry.Context(r.ctx))
|
||||
// Report the job outcome even when all log upload retry attempts have been exhausted
|
||||
return errors.Join(
|
||||
retry.Do(func() error {
|
||||
return r.ReportLog(true)
|
||||
}, retry.Context(r.ctx)),
|
||||
retry.Do(func() error {
|
||||
return r.ReportState(true)
|
||||
}, retry.Context(r.ctx)),
|
||||
)
|
||||
}
|
||||
|
||||
func (r *Reporter) ReportLog(noMore bool) error {
|
||||
@@ -296,10 +300,11 @@ func (r *Reporter) ReportLog(noMore bool) error {
|
||||
|
||||
r.stateMu.Lock()
|
||||
r.logRows = r.logRows[ack-r.logOffset:]
|
||||
submitted := r.logOffset + len(rows)
|
||||
r.logOffset = ack
|
||||
r.stateMu.Unlock()
|
||||
|
||||
if noMore && ack < r.logOffset+len(rows) {
|
||||
if noMore && ack < submitted {
|
||||
return fmt.Errorf("not all logs are submitted")
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user