gitlab-org--gitlab-foss/app/workers/repository_check/clear_worker.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

25 lines
680 B
Ruby
Raw Normal View History

# frozen_string_literal: true
module RepositoryCheck
class ClearWorker # rubocop:disable Scalability/IdempotentWorker
include ApplicationWorker
data_consistency :always
sidekiq_options retry: 3
include RepositoryCheckQueue
2016-04-14 16:28:48 +00:00
# rubocop: disable CodeReuse/ActiveRecord
def perform
2016-04-13 15:33:25 +00:00
# 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
# rubocop: enable CodeReuse/ActiveRecord
end
2016-04-14 16:28:48 +00:00
end