Skip to content

Commit

Permalink
Drop IDOrderDesc for listing Actions task and always order by `id D…
Browse files Browse the repository at this point in the history
…ESC` (go-gitea#31150)

Close go-gitea#31066

Just follow what `FindRunOptions` and `FindScheduleOptions` do.
  • Loading branch information
wolfogre authored May 31, 2024
1 parent 1137a03 commit 572fa55
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
6 changes: 1 addition & 5 deletions models/actions/task_list.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ type FindTaskOptions struct {
UpdatedBefore timeutil.TimeStamp
StartedBefore timeutil.TimeStamp
RunnerID int64
IDOrderDesc bool
}

func (opts FindTaskOptions) ToConds() builder.Cond {
Expand Down Expand Up @@ -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"
}
5 changes: 2 additions & 3 deletions routers/web/shared/actions/runners.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 572fa55

Please sign in to comment.