1
Fork 0

chore: Remove ScheduleList

- Introduced in 0d55f64e6c and removed in df1e7d0067.
This commit is contained in:
Gusted 2025-01-31 12:00:21 +01:00
parent 5423e22aeb
commit 581a2ca341
No known key found for this signature in database
GPG key ID: FD821B732837125F
3 changed files with 24 additions and 89 deletions

View file

@ -14,6 +14,8 @@ import (
"code.gitea.io/gitea/modules/timeutil"
"code.gitea.io/gitea/modules/util"
webhook_module "code.gitea.io/gitea/modules/webhook"
"xorm.io/builder"
)
// ActionSchedule represents a schedule of a workflow file
@ -140,3 +142,25 @@ func CleanRepoScheduleTasks(ctx context.Context, repo *repo_model.Repository, ca
}
return nil
}
type FindScheduleOptions struct {
db.ListOptions
RepoID int64
OwnerID int64
}
func (opts FindScheduleOptions) ToConds() builder.Cond {
cond := builder.NewCond()
if opts.RepoID > 0 {
cond = cond.And(builder.Eq{"repo_id": opts.RepoID})
}
if opts.OwnerID > 0 {
cond = cond.And(builder.Eq{"owner_id": opts.OwnerID})
}
return cond
}
func (opts FindScheduleOptions) ToOrders() string {
return "`id` DESC"
}