From 03a2c06347c3bbf79bebddd14076c19180f6d0cb Mon Sep 17 00:00:00 2001 From: Christopher Homberger Date: Fri, 14 Nov 2025 17:28:47 +0100 Subject: [PATCH] fixup --- models/actions/task.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/models/actions/task.go b/models/actions/task.go index 01035d60c4..7fb21d82be 100644 --- a/models/actions/task.go +++ b/models/actions/task.go @@ -260,9 +260,12 @@ func CreateTaskForRunner(ctx context.Context, runner *ActionRunner) (*ActionTask for page := 0; job == nil; page++ { var jobs []*ActionRunJob // 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).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 } + if len(jobs) == 0 { + break + } // TODO: a more efficient way to filter labels log.Trace("runner labels: %v", runner.AgentLabels)