summaryrefslogtreecommitdiff
path: root/app/workers/repository_check/clear_worker.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/workers/repository_check/clear_worker.rb')
-rw-r--r--app/workers/repository_check/clear_worker.rb17
1 files changed, 17 insertions, 0 deletions
diff --git a/app/workers/repository_check/clear_worker.rb b/app/workers/repository_check/clear_worker.rb
new file mode 100644
index 00000000000..b7202ddff34
--- /dev/null
+++ b/app/workers/repository_check/clear_worker.rb
@@ -0,0 +1,17 @@
+module RepositoryCheck
+ class ClearWorker
+ include Sidekiq::Worker
+
+ sidekiq_options retry: false
+
+ 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
+ end
+end