BigW Consortium Gitlab

admin_email_worker.rb 366 Bytes
Newer Older
Jacob Vosmaer committed
1 2 3 4 5 6
class AdminEmailWorker
  include Sidekiq::Worker

  sidekiq_options retry: false # this job auto-repeats via sidekiq-cron

  def perform
7 8
    repository_check_failed_count = Project.where(last_repository_check_failed: true).count
    return if repository_check_failed_count.zero?
Jacob Vosmaer committed
9

10
    RepositoryCheckMailer.notify(repository_check_failed_count).deliver_now
Jacob Vosmaer committed
11 12
  end
end