BigW Consortium Gitlab

clear_worker.rb 449 Bytes
Newer Older
1 2 3
module RepositoryCheck
  class ClearWorker
    include Sidekiq::Worker
4
    include RepositoryCheckQueue
Robert Speicher committed
5

6
    def perform
7 8
      # Do small batched updates because these updates will be slow and locking
      Project.select(:id).find_in_batches(batch_size: 100) do |batch|
9 10
        Project.where(id: batch.map(&:id)).update_all(
          last_repository_check_failed: nil,
11
          last_repository_check_at: nil
12 13 14 15
        )
      end
    end
  end
Robert Speicher committed
16
end