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