Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKamil Trzcinski <ayufan@ayufan.eu>2016-06-12 16:15:58 +0300
committerKamil Trzcinski <ayufan@ayufan.eu>2016-06-12 16:15:58 +0300
commite6d66c4d3b8bdaa4abc85f3f35e0b06b785008da (patch)
tree1e29fc1325645c0810a1cf99e0e145995c728082 /app/workers
parentb4e84809e8170a43126507da0bc6a3b94c33804b (diff)
Don't fail builds for projects that are deleted when they are stuck
Diffstat (limited to 'app/workers')
-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