Skip to content

Commit 8699c5a

Browse files
committed
fix paging
1 parent 6cca172 commit 8699c5a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

models/actions/task.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ func CreateTaskForRunner(ctx context.Context, runner *ActionRunner) (*ActionTask
260260
for page := 0; job == nil; page++ {
261261
var jobs []*ActionRunJob
262262
// Load only 10 job in a batch without all fields for memory / db load reduction
263-
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 {
263+
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 {
264264
return nil, false, err
265265
}
266266

0 commit comments

Comments
 (0)