Class: RepositoryCheck::ClearWorker

Inherits:
Object
  • Object
show all
Includes:
Sidekiq::Worker
Defined in:
app/workers/repository_check/clear_worker.rb

Instance Method Summary collapse

Instance Method Details

#performObject


7
8
9
10
11
12
13
14
15
# File 'app/workers/repository_check/clear_worker.rb', line 7

def perform
  # 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,
    )
  end
end