summaryrefslogtreecommitdiff
path: root/app/workers
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
parent13e37a3ee5c943525a99481b855d654e97e8597c (diff)
downloadgitlab-ce-452c076a34cc11cc97f4b1c3113e86ce4367e055.tar.gz
Revert "squashed merge and fixed conflicts"
This reverts commit 13e37a3ee5c943525a99481b855d654e97e8597c.
Diffstat (limited to 'app/workers')
-rw-r--r--app/workers/expire_build_artifacts_worker.rb13
-rw-r--r--app/workers/stuck_ci_builds_worker.rb2
2 files changed, 1 insertions, 14 deletions
diff --git a/app/workers/expire_build_artifacts_worker.rb b/app/workers/expire_build_artifacts_worker.rb
deleted file mode 100644
index c64ea108d52..00000000000
--- a/app/workers/expire_build_artifacts_worker.rb
+++ /dev/null
@@ -1,13 +0,0 @@
-class ExpireBuildArtifactsWorker
- include Sidekiq::Worker
-
- def perform
- Rails.logger.info 'Cleaning old build artifacts'
-
- builds = Ci::Build.with_expired_artifacts
- builds.find_each(batch_size: 50).each do |build|
- Rails.logger.debug "Removing artifacts build #{build.id}..."
- build.erase_artifacts!
- end
- end
-end
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