mirror of
https://github.com/Evolix/chexpire.git
synced 2024-05-11 13:08:39 +02:00
Merge 5152856334
into 6086b0a48f
This commit is contained in:
commit
5dee73685f
|
@ -29,10 +29,15 @@ module CheckProcessor
|
||||||
end
|
end
|
||||||
|
|
||||||
group_finished_at = Time.now
|
group_finished_at = Time.now
|
||||||
|
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).all
|
||||||
|
|
||||||
check_errors_scope(check_ids: checks.map(&:id),
|
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
|
||||||
after_date: group_started_at,
|
logger.debug(message)
|
||||||
before_date: group_finished_at).includes(:check).each do |check_log|
|
|
||||||
|
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
|
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)
|
logger.error(message)
|
||||||
end
|
end
|
||||||
|
|
|
@ -5,7 +5,8 @@
|
||||||
|
|
||||||
set :output, standard: "log/cron.log"
|
set :output, standard: "log/cron.log"
|
||||||
|
|
||||||
#
|
job_type :rake_with_stdout, "cd :path && :environment_variable=:environment bundle exec rake :task"
|
||||||
|
|
||||||
# every 2.hours do
|
# every 2.hours do
|
||||||
# command "/usr/bin/some_great_command"
|
# command "/usr/bin/some_great_command"
|
||||||
# runner "MyModel.some_method"
|
# runner "MyModel.some_method"
|
||||||
|
@ -19,7 +20,7 @@ set :output, standard: "log/cron.log"
|
||||||
# Learn more: http://github.com/javan/whenever
|
# Learn more: http://github.com/javan/whenever
|
||||||
|
|
||||||
every 1.day, at: '1:00 am', roles: [:app] do
|
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
|
end
|
||||||
|
|
||||||
every 1.day, at: '8:30 am', roles: [:app] do
|
every 1.day, at: '8:30 am', roles: [:app] do
|
||||||
|
|
Loading…
Reference in a new issue