diff options
author | Jason Song <i@wolfogre.com> | 2024-05-31 10:30:02 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-05-31 02:30:02 +0000 |
commit | 572fa55fbcc2cb9418b4f7b981a7c80a11899276 (patch) | |
tree | a6767b5ef026074af4249375c441ad89d96188d2 | |
parent | 1137a0357eb1e35a046e86a7277594154d0f6c85 (diff) | |
download | gitea-572fa55fbcc2cb9418b4f7b981a7c80a11899276.tar.gz gitea-572fa55fbcc2cb9418b4f7b981a7c80a11899276.zip |
Drop `IDOrderDesc` for listing Actions task and always order by `id DESC` (#31150)
Close #31066
Just follow what `FindRunOptions` and `FindScheduleOptions` do.
-rw-r--r-- | models/actions/task_list.go | 6 | ||||
-rw-r--r-- | routers/web/shared/actions/runners.go | 5 |
2 files changed, 3 insertions, 8 deletions
diff --git a/models/actions/task_list.go b/models/actions/task_list.go index 5e17f91441..df4b43c5ef 100644 --- a/models/actions/task_list.go +++ b/models/actions/task_list.go @@ -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" } diff --git a/routers/web/shared/actions/runners.go b/routers/web/shared/actions/runners.go index 34b7969442..f38933226b 100644 --- a/routers/web/shared/actions/runners.go +++ b/routers/web/shared/actions/runners.go @@ -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) |