class Delayed::Plugins::Reporting::JobListener

Public Class Methods

new(reporter:) click to toggle source
# File lib/delayed-plugins-reporting/job_listener.rb, line 3
def initialize(reporter:)
  @reporter = reporter
end

Public Instance Methods

job_retried(job) click to toggle source
# File lib/delayed-plugins-reporting/job_listener.rb, line 13
    def job_retried(job)
      report.error :job_retried, job: job, message: <<-EOS.gsub!(/^\s+/, '')
        The job retried.
      EOS
    end
max_attempts_exceeded(job) click to toggle source
# File lib/delayed-plugins-reporting/job_listener.rb, line 7
    def max_attempts_exceeded(job)
      report.error :max_attempts_exceeded, job: job, message: <<-EOS.gsub!(/^\s+/, '')
        The job failed `max_attempts` times and was given up retrying.
      EOS
    end

Private Instance Methods

report() click to toggle source
# File lib/delayed-plugins-reporting/job_listener.rb, line 21
def report
  @reporter
end