You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
14 lines
367 B
14 lines
367 B
# app/jobs/training_watch_job.rb
|
|
class TrainingWatchJob < ApplicationJob
|
|
queue_as :default
|
|
|
|
def perform
|
|
results = TrainingWatch::Checker.new.run!
|
|
return if results.empty?
|
|
|
|
email = ENV.fetch("TRAINING_WATCH_NOTIFY_EMAIL", "christoph@marzell.net")
|
|
return if email.blank?
|
|
|
|
TrainingWatchMailer.notify(email: email, results: results).deliver_now
|
|
end
|
|
end
|