gitlab-org--gitlab-foss/app/workers/admin_email_worker.rb

13 lines
366 B
Ruby
Raw Normal View History

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