mirror of
https://github.com/go-gitea/gitea.git
synced 2026-10-03 08:45:33 +02:00
fix paging
This commit is contained in:
1 parent
6cca172a65
commit
8699c5a30d
1 file changed
+1
-1
@@ -260,7 +260,7 @@ func CreateTaskForRunner(ctx context.Context, runner *ActionRunner) (*ActionTask
|
|||||||
for page := 0; job == nil; page++ {
|
for page := 0; job == nil; page++ {
|
||||||
var jobs []*ActionRunJob
|
var jobs []*ActionRunJob
|
||||||
// Load only 10 job in a batch without all fields for memory / db load reduction
|
// Load only 10 job in a batch without all fields for memory / db load reduction
|
||||||
if err := e.Where("task_id=? AND status=? AND updated>=?", 0, StatusWaiting, lastUpdated).Cols("id", "runs_on").And(jobCond).Asc("updated", "id").Limit(limit, page*limit).Find(&jobs); err != nil {
|
if err := e.Where("task_id=? AND status=? AND updated>=?", 0, StatusWaiting, lastUpdated).Cols("id", "runs_on").And(jobCond).Asc("updated", "id").Limit(limit).Find(&jobs); err != nil {
|
||||||
return nil, false, err
|
return nil, false, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user