summaryrefslogtreecommitdiff
path: root/app/workers/stuck_ci_builds_worker.rb
diff options
context:
space:
mode:
authorJames Lopez <james@jameslopez.es>2016-06-16 12:12:27 +0200
committerJames Lopez <james@jameslopez.es>2016-06-16 12:12:28 +0200
commit13e37a3ee5c943525a99481b855d654e97e8597c (patch)
tree21cd6acfe884046eeb32bc23095b6a2f9f02c8cb /app/workers/stuck_ci_builds_worker.rb
parent9be06bbbb40a64b060fe9042fc84817551dfed08 (diff)
downloadgitlab-ce-13e37a3ee5c943525a99481b855d654e97e8597c.tar.gz
squashed merge and fixed conflicts
Diffstat (limited to 'app/workers/stuck_ci_builds_worker.rb')
-rw-r--r--app/workers/stuck_ci_builds_worker.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/workers/stuck_ci_builds_worker.rb b/app/workers/stuck_ci_builds_worker.rb
index ca594e77e7c..6828013b377 100644
--- a/app/workers/stuck_ci_builds_worker.rb
+++ b/app/workers/stuck_ci_builds_worker.rb
@@ -6,7 +6,7 @@ class StuckCiBuildsWorker
def perform
Rails.logger.info 'Cleaning stuck builds'
- builds = Ci::Build.running_or_pending.where('updated_at < ?', BUILD_STUCK_TIMEOUT.ago)
+ builds = Ci::Build.joins(:project).running_or_pending.where('ci_builds.updated_at < ?', BUILD_STUCK_TIMEOUT.ago)
builds.find_each(batch_size: 50).each do |build|
Rails.logger.debug "Dropping stuck #{build.status} build #{build.id} for runner #{build.runner_id}"
build.drop