Fix wrong last step duration when job failed #41

Merged
HesterG merged 2 commits from fix-failed-job-last-duration into main 2023-03-08 13:32:55 +00:00
HesterG commented 2023-03-07 10:24:05 +00:00 (Migrated from gitea.com)

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.

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.
wolfogre (Migrated from gitea.com) approved these changes 2023-03-07 10:34:45 +00:00
lunny (Migrated from gitea.com) approved these changes 2023-03-08 03:01:28 +00:00
Sign in to join this conversation.