mirror of
https://code.forgejo.org/forgejo/runner.git
synced 2025-09-15 18:57:01 +00:00
feat: log a descriptive message when a job exceeds the config timeout
- change the argument from string to error to differentiate a timeout error - when there is a timeout, display a message more descriptive than "context deadline" - always set the StoppedAt state value instead of only if the result was unspecified: it is the last state update.
This commit is contained in:
parent
bd2b7d2b32
commit
25879b92f4
3 changed files with 115 additions and 17 deletions
|
@ -170,11 +170,7 @@ func (r *Runner) Run(ctx context.Context, task *runnerv1.Task) error {
|
|||
reporter := report.NewReporter(ctx, cancel, r.client, task, r.cfg.Runner.ReportInterval)
|
||||
var runErr error
|
||||
defer func() {
|
||||
lastWords := ""
|
||||
if runErr != nil {
|
||||
lastWords = runErr.Error()
|
||||
}
|
||||
_ = reporter.Close(lastWords)
|
||||
_ = reporter.Close(runErr)
|
||||
}()
|
||||
reporter.RunDaemon()
|
||||
runErr = r.run(ctx, task, reporter)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue