1
1
mirror of https://github.com/go-gitea/gitea synced 2025-09-28 03:28:13 +00:00

fix: use updated to check abandoned jobs

This commit is contained in:
Jason Song
2022-11-07 15:09:13 +08:00
parent 0b62e1da74
commit cab3fc072a
4 changed files with 12 additions and 12 deletions

View File

@@ -61,7 +61,7 @@ type FindRunJobOptions struct {
db.ListOptions
RunID int64
Statuses []Status
StartedBefore timeutil.TimeStamp
UpdatedBefore timeutil.TimeStamp
}
func (opts FindRunJobOptions) toConds() builder.Cond {
@@ -72,8 +72,8 @@ func (opts FindRunJobOptions) toConds() builder.Cond {
if len(opts.Statuses) > 0 {
cond = cond.And(builder.In("status", opts.Statuses))
}
if opts.StartedBefore > 0 {
cond = cond.And(builder.Lt{"started": opts.StartedBefore})
if opts.UpdatedBefore > 0 {
cond = cond.And(builder.Lt{"updated": opts.UpdatedBefore})
}
return cond
}