Class: CodeSunset::EvaluateAlertsJob

Inherits:
ApplicationJob show all
Defined in:
app/jobs/code_sunset/evaluate_alerts_job.rb

Instance Method Summary collapse

Instance Method Details

#perform(feature_key = nil) ⇒ Object



5
6
7
8
9
10
11
12
13
# File 'app/jobs/code_sunset/evaluate_alerts_job.rb', line 5

def perform(feature_key = nil)
  if feature_key.present?
    CodeSunset::AlertDispatcher.new(feature_key).dispatch_if_due
  else
    CodeSunset::Feature.find_each do |feature|
      CodeSunset::AlertDispatcher.new(feature.key).dispatch_if_due
    end
  end
end