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

18 lines
453 B
Ruby
Raw Normal View History

2016-06-02 11:05:42 +05:30
class AdminEmailWorker
2018-03-17 18:26:18 +05:30
include ApplicationWorker
2016-11-03 12:29:30 +05:30
include CronjobQueue
2016-06-02 11:05:42 +05:30
def perform
2018-10-15 14:42:47 +05:30
send_repository_check_mail if Gitlab::CurrentSettings.repository_checks_enabled
end
private
def send_repository_check_mail
2016-06-02 11:05:42 +05:30
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