summaryrefslogtreecommitdiff
path: root/app/workers/stuck_ci_builds_worker.rb
diff options
context:
space:
mode:
authorJames Lopez <james@jameslopez.es>2016-06-16 12:59:07 +0200
committerJames Lopez <james@jameslopez.es>2016-06-16 12:59:07 +0200
commit452c076a34cc11cc97f4b1c3113e86ce4367e055 (patch)
treea503b33dc6dd181e2cf56d5965fc1eb822b4d9f9 /app/workers/stuck_ci_builds_worker.rb
parent13e37a3ee5c943525a99481b855d654e97e8597c (diff)
downloadgitlab-ce-452c076a34cc11cc97f4b1c3113e86ce4367e055.tar.gz
Revert "squashed merge and fixed conflicts"
This reverts commit 13e37a3ee5c943525a99481b855d654e97e8597c.
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 6828013b377..ca594e77e7c 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.joins(:project).running_or_pending.where('ci_builds.updated_at < ?', BUILD_STUCK_TIMEOUT.ago)
+ builds = Ci::Build.running_or_pending.where('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