diff options
author | Jacob Vosmaer <contact@jacobvosmaer.nl> | 2016-04-13 17:33:25 +0200 |
---|---|---|
committer | Jacob Vosmaer <contact@jacobvosmaer.nl> | 2016-04-13 17:33:25 +0200 |
commit | 6f6d2d0ad5039fa8ace7e09c4f5867bb680b0f79 (patch) | |
tree | e8419624393e8224e2e55f006685a84a27afa021 /app/workers | |
parent | bf31b4495e020ef5fa45b204d2494d8d3b4d1494 (diff) | |
download | gitlab-ce-6f6d2d0ad5039fa8ace7e09c4f5867bb680b0f79.tar.gz |
Use more conservative limits
Diffstat (limited to 'app/workers')
-rw-r--r-- | app/workers/repository_check/batch_worker.rb | 2 | ||||
-rw-r--r-- | app/workers/repository_check/clear_worker.rb | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/app/workers/repository_check/batch_worker.rb b/app/workers/repository_check/batch_worker.rb index 16cd77a9bf0..44b3145d50f 100644 --- a/app/workers/repository_check/batch_worker.rb +++ b/app/workers/repository_check/batch_worker.rb @@ -35,7 +35,7 @@ module RepositoryCheck limit = 10_000 never_checked_projects = Project.where('last_repository_check_at IS NULL').limit(limit). pluck(:id) - old_check_projects = Project.where('last_repository_check_at < ?', 1.week.ago). + old_check_projects = Project.where('last_repository_check_at < ?', 1.month.ago). reorder('last_repository_check_at ASC').limit(limit).pluck(:id) never_checked_projects + old_check_projects end diff --git a/app/workers/repository_check/clear_worker.rb b/app/workers/repository_check/clear_worker.rb index fe0cce9aab7..9c3347a7040 100644 --- a/app/workers/repository_check/clear_worker.rb +++ b/app/workers/repository_check/clear_worker.rb @@ -5,8 +5,8 @@ module RepositoryCheck sidekiq_options retry: false def perform - # Do batched updates because these updates will be slow and locking - Project.select(:id).find_in_batches(batch_size: 1000) do |batch| + # Do small batched updates because these updates will be slow and locking + Project.select(:id).find_in_batches(batch_size: 100) do |batch| Project.where(id: batch.map(&:id)).update_all( last_repository_check_failed: nil, last_repository_check_at: nil, |