debian-mirror-gitlab/app/workers/admin_email_worker.rb

13 lines
366 B
Ruby
Raw Normal View History

2016-06-02 11:05:42 +05:30
class AdminEmailWorker
include Sidekiq::Worker
sidekiq_options retry: false # this job auto-repeats via sidekiq-cron
def perform
repository_check_failed_count = Project.where(last_repository_check_failed: true).count
return if repository_check_failed_count.zero?
RepositoryCheckMailer.notify(repository_check_failed_count).deliver_now
end
end