6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
# File 'app/jobs/schedule_by_interval_job.rb', line 6
def perform(options, one_by_one = false)
if one_by_one
MyNagios::Check.enabled.not_snoozed.where(interval: options['interval']).each do |check|
MonitoringJob.perform_async(check)
end
return
end
MyNagios::Check.enabled.not_snoozed.where(interval: options['interval']).group_by{|check| { host: check.host, user: check.user, pem_key: check.pem_key } }.each do |config, checks|
MonitoringJob.perform_async(checks.map(&:id), config)
end
end
|