lib/job_runner/health_checker.rb
# Return whether there has been a succesful run of the given job
# configuration in the last N runs, where N is the job configuration's
# defined `failures_before_alarm`.
#
# @param [JobConfiguration] job_configuration
# @return [Boolean]
#
Return whether there has been a succesful run of the given job
configuration in the last N runs, where N is the job configuration's
defined `failures_before_alarm`.
Return whether there has been a succesful run of the given job configuration in the last N runs where N is the job configuration ' s defined ` failures_before_alarm ` .
def successful_recent_job_run?(job_configuration)
        interval_window = job_configuration.interval * job_configuration.failures_before_alarm
        JobRun.where(job_name: job_configuration.name, error: nil).
          where('created_at > ?', interval_window.seconds.ago).
          any?
      end
def successful_recent_job_run? ( job_configuration ) interval_window = job_configuration . interval * job_configuration . failures_before_alarm JobRun . where ( job_name : job_configuration . name , error : nil ) . where ( 'created_at > ?' , interval_window . seconds . ago ) . any? end
Return whether there has been a succesful run of the given job
configuration in the last N runs, where N is the job configuration's
defined `failures_before_alarm`.
Return whether there has been a succesful run of the given job configuration in the last N runs where N is the job configuration ' s defined ` failures_before_alarm ` .
None
Boolean
job_configuration
<not_specific>
<not_specific>
None