mirror of
https://github.com/go-gitea/gitea.git
synced 2026-10-24 14:25:02 +02:00
fix: use updated to check abandoned jobs
This commit is contained in:
1 parent
0b62e1da74
commit
cab3fc072a
4 files changed
+12
-12
No files matched your search
@@ -65,7 +65,7 @@ func StopEndlessTasks(ctx context.Context) error {
|
||||
func CancelAbandonedJobs(ctx context.Context) error {
|
||||
jobs, _, err := bots_model.FindRunJobs(ctx, bots_model.FindRunJobOptions{
|
||||
Statuses: []bots_model.Status{bots_model.StatusWaiting, bots_model.StatusBlocked},
|
||||
StartedBefore: timeutil.TimeStamp(time.Now().Add(-abandonedJobTimeout).Unix()),
|
||||
UpdatedBefore: timeutil.TimeStamp(time.Now().Add(-abandonedJobTimeout).Unix()),
|
||||
})
|
||||
if err != nil {
|
||||
log.Warn("find abandoned tasks: %v", err)
|
||||
|
||||
Reference in new issue
Block a user