-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
actions task displays an incorrect time #28323
Comments
The duration in the first pic is calculated by the records in |
It seems that this run was scheduled twice.
So I guess: |
This issue is not related to cron job.
I will try to fix it. This issue is caused by the codes here: gitea/models/actions/run_job.go Lines 140 to 146 in 876a0cb
When a job finished before executed once, e.g. no target runner and canceled manually, the Stopped time is not 0 but the Started time is 0 .So if you rerun it, only Started time will be updated, but the Stopped time won't. Then you will get a minus duration time, as it is calculated by Stopped - Started .
|
… once (#28364) Fix #28323 Reason was mentioned here: #28323 (comment) ### Changes: (maybe breaking) We can rerun jobs in Gitea, so there will be some problems in calculating duration time. In this PR, I use the exist `Started` and `Stopped` column to record the last run time instead of the total time, and add a new `PreviousDuration` column to record the previous duration time. You can also check the cost time of last run: ![image](https://github.com/go-gitea/gitea/assets/18380374/2ca39145-2c92-401a-b78b-43164f7ae061)
… once (go-gitea#28364) Fix go-gitea#28323 Reason was mentioned here: go-gitea#28323 (comment) ### Changes: (maybe breaking) We can rerun jobs in Gitea, so there will be some problems in calculating duration time. In this PR, I use the exist `Started` and `Stopped` column to record the last run time instead of the total time, and add a new `PreviousDuration` column to record the previous duration time. You can also check the cost time of last run: ![image](https://github.com/go-gitea/gitea/assets/18380374/2ca39145-2c92-401a-b78b-43164f7ae061)
… once (go-gitea#28364) Fix go-gitea#28323 Reason was mentioned here: go-gitea#28323 (comment) ### Changes: (maybe breaking) We can rerun jobs in Gitea, so there will be some problems in calculating duration time. In this PR, I use the exist `Started` and `Stopped` column to record the last run time instead of the total time, and add a new `PreviousDuration` column to record the previous duration time. You can also check the cost time of last run: ![image](https://github.com/go-gitea/gitea/assets/18380374/2ca39145-2c92-401a-b78b-43164f7ae061)
Automatically locked because of our CONTRIBUTING guidelines |
Description
I'm using sqlite and found this bug during a routine weekly check, not sure how to reproduce it for now.
Gitea Version
main
Can you reproduce the bug on the Gitea demo site?
No
Log Gist
No response
Screenshots
No response
Git Version
No response
Operating System
No response
How are you running Gitea?
systemd
Database
SQLite
The text was updated successfully, but these errors were encountered: