0
0
Fork 0
mirror of https://github.com/go-gitea/gitea synced 2024-11-22 02:14:27 +01:00

Drop IDOrderDesc for listing Actions task and always order by id DESC (#31150)

Close #31066

Just follow what `FindRunOptions` and `FindScheduleOptions` do.
This commit is contained in:
Jason Song 2024-05-31 10:30:02 +08:00 committed by GitHub
parent 1137a0357e
commit 572fa55fbc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 3 additions and 8 deletions

View file

@ -54,7 +54,6 @@ type FindTaskOptions struct {
UpdatedBefore timeutil.TimeStamp
StartedBefore timeutil.TimeStamp
RunnerID int64
IDOrderDesc bool
}
func (opts FindTaskOptions) ToConds() builder.Cond {
@ -84,8 +83,5 @@ func (opts FindTaskOptions) ToConds() builder.Cond {
}
func (opts FindTaskOptions) ToOrders() string {
if opts.IDOrderDesc {
return "`id` DESC"
}
return ""
return "`id` DESC"
}

View file

@ -79,9 +79,8 @@ func RunnerDetails(ctx *context.Context, page int, runnerID, ownerID, repoID int
Page: page,
PageSize: 30,
},
Status: actions_model.StatusUnknown, // Unknown means all
IDOrderDesc: true,
RunnerID: runner.ID,
Status: actions_model.StatusUnknown, // Unknown means all
RunnerID: runner.ID,
}
tasks, count, err := db.FindAndCount[actions_model.ActionTask](ctx, opts)