Actions FetchTask concurrently picked jobs is an error for the runner

* Before this Gitea claimed no job is available to be picked in this case
* The runner had to wait for an external taskversion increment
* Now act_runner is notified about an error and retries the request later without updating its taskversion
This commit is contained in:
ChristopherHX 2025-02-04 23:09:26 +01:00 committed by GitHub
parent 09a3b07f10
commit 0395d5c9f5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -317,7 +317,7 @@ func CreateTaskForRunner(ctx context.Context, runner *ActionRunner) (*ActionTask
if n, err := UpdateRunJob(ctx, job, builder.Eq{"task_id": 0}); err != nil {
return nil, false, err
} else if n != 1 {
return nil, false, nil
return nil, false, fmt.Errorf("other runner picked up our job")
}
task.Job = job