mirror of
https://github.com/Evolix/chexpire.git
synced 2024-05-11 04:58:38 +02:00
Merge 5152856334
into 6086b0a48f
This commit is contained in:
commit
5dee73685f
|
@ -29,10 +29,15 @@ module CheckProcessor
|
|||
end
|
||||
|
||||
group_finished_at = Time.now
|
||||
|
||||
check_errors_scope(check_ids: checks.map(&:id),
|
||||
check_ids = checks.map(&:id)
|
||||
check_logs = check_errors_scope(check_ids: check_ids,
|
||||
after_date: group_started_at,
|
||||
before_date: group_finished_at).includes(:check).each do |check_log|
|
||||
before_date: group_finished_at).includes(:check).all
|
||||
|
||||
message = "#{self.class.name}: #{check_logs.count} error(s) found for checks '#{check_ids.join(',')}' between '#{group_started_at}' and '#{group_finished_at}'" # rubocop:disable Metrics/LineLength
|
||||
logger.debug(message)
|
||||
|
||||
check_logs.each do |check_log|
|
||||
message = "#{self.class.name}: check ##{check_log.check_id} for '#{check_log.check.domain}' failed (#{check_log.exit_status}) ; #{check_log.error.lines.first}" # rubocop:disable Metrics/LineLength
|
||||
logger.error(message)
|
||||
end
|
||||
|
|
|
@ -5,7 +5,8 @@
|
|||
|
||||
set :output, standard: "log/cron.log"
|
||||
|
||||
#
|
||||
job_type :rake_with_stdout, "cd :path && :environment_variable=:environment bundle exec rake :task"
|
||||
|
||||
# every 2.hours do
|
||||
# command "/usr/bin/some_great_command"
|
||||
# runner "MyModel.some_method"
|
||||
|
@ -19,7 +20,7 @@ set :output, standard: "log/cron.log"
|
|||
# Learn more: http://github.com/javan/whenever
|
||||
|
||||
every 1.day, at: '1:00 am', roles: [:app] do
|
||||
rake "checks:sync_dates:all"
|
||||
rake_with_stdout "checks:sync_dates:all VERBOSE=1"
|
||||
end
|
||||
|
||||
every 1.day, at: '8:30 am', roles: [:app] do
|
||||
|
|
Loading…
Reference in a new issue