Commit 5bc6a021 authored by Robert Speicher's avatar Robert Speicher

Merge branch 'bvl-add-context-to-stuck-ci-jobs-worker' into 'master'

Add context to the StuckCiJobsWorker

See merge request gitlab-org/gitlab!24693
parents 821e9412 15204499
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
class StuckCiJobsWorker class StuckCiJobsWorker
include ApplicationWorker include ApplicationWorker
include CronjobQueue # rubocop:disable Scalability/CronWorkerContext include CronjobQueue
feature_category :continuous_integration feature_category :continuous_integration
worker_resource_boundary :cpu worker_resource_boundary :cpu
...@@ -56,13 +56,13 @@ class StuckCiJobsWorker ...@@ -56,13 +56,13 @@ class StuckCiJobsWorker
loop do loop do
jobs = Ci::Build.where(status: status) jobs = Ci::Build.where(status: status)
.where(condition, timeout.ago) .where(condition, timeout.ago)
.includes(:tags, :runner, project: :namespace) .includes(:tags, :runner, project: [:namespace, :route])
.limit(100) .limit(100)
.to_a .to_a
break if jobs.empty? break if jobs.empty?
jobs.each do |job| jobs.each do |job|
yield(job) with_context(project: job.project) { yield(job) }
end end
end end
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment