mirror of
https://gitea.com/gitea/runner.git
synced 2026-11-05 23:05:45 +00:00
Fix wrong last step duration when job failed (#41)
This PR is to fix the wrong last step duration when job failed like shown in the screenshot. The reason is because when job failed, `Fire` function did not pass in Time, and `r.state.StoppedAt` is by default set to `0001-01-01 08:05:43 +0805 LMT`, which is later on reported to gitea by `UpdateTask`, which calls `UpdateTaskByState` to update the `task.Stopped`, and `task.Stopped` is used in `FullSteps`, resulting in wrong calcaulation of last step duration. Co-authored-by: nickname <[email protected]> Co-authored-by: Lunny Xiao <[email protected]> Reviewed-on: https://gitea.com/gitea/act_runner/pulls/41 Reviewed-by: Jason Song <[email protected]> Reviewed-by: Lunny Xiao <[email protected]> Co-authored-by: HesterG <[email protected]> Co-committed-by: HesterG <[email protected]>
This commit is contained in:
1 parent
14334f76ed
commit
ebcf341de7
1 file changed
+1
@@ -137,6 +137,7 @@ func (t *Task) Run(ctx context.Context, task *runnerv1.Task, runnerName string)
|
|||||||
Data: log.Fields{
|
Data: log.Fields{
|
||||||
"jobResult": "failure",
|
"jobResult": "failure",
|
||||||
},
|
},
|
||||||
|
Time: time.Now(),
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
_ = reporter.Close(lastWords)
|
_ = reporter.Close(lastWords)
|
||||||
|
|||||||
Reference in new issue
Block a user