2016-06-02 11:05:42 +05:30
|
|
|
module RepositoryCheck
|
|
|
|
class ClearWorker
|
2018-03-17 18:26:18 +05:30
|
|
|
include ApplicationWorker
|
2016-11-03 12:29:30 +05:30
|
|
|
include RepositoryCheckQueue
|
2016-06-02 11:05:42 +05:30
|
|
|
|
|
|
|
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,
|
2017-09-10 17:25:29 +05:30
|
|
|
last_repository_check_at: nil
|
2016-06-02 11:05:42 +05:30
|
|
|
)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|