diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-10 21:09:00 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-10 21:09:00 +0300 |
commit | c57e10faab0abb213e7a18274fd5a98ba87a5c09 (patch) | |
tree | de0195e28dfe19fbfeb5bffa8fde4f511288d8ef /app/workers/stuck_ci_jobs_worker.rb | |
parent | 11e5d1b9ca3efa7be34ddebb708a6aedb4e91639 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/workers/stuck_ci_jobs_worker.rb')
-rw-r--r-- | app/workers/stuck_ci_jobs_worker.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/app/workers/stuck_ci_jobs_worker.rb b/app/workers/stuck_ci_jobs_worker.rb index 7e3f7275b55..6e4ffa36854 100644 --- a/app/workers/stuck_ci_jobs_worker.rb +++ b/app/workers/stuck_ci_jobs_worker.rb @@ -2,7 +2,7 @@ class StuckCiJobsWorker include ApplicationWorker - include CronjobQueue # rubocop:disable Scalability/CronWorkerContext + include CronjobQueue feature_category :continuous_integration worker_resource_boundary :cpu @@ -56,13 +56,13 @@ class StuckCiJobsWorker loop do jobs = Ci::Build.where(status: status) .where(condition, timeout.ago) - .includes(:tags, :runner, project: :namespace) + .includes(:tags, :runner, project: [:namespace, :route]) .limit(100) .to_a break if jobs.empty? jobs.each do |job| - yield(job) + with_context(project: job.project) { yield(job) } end end end |