class SidekiqUniqueJobs::Orphans::Observer

Observes the Orphan::Manager and provides information about each execution

@author Mikael Henriksson <mikael@mhenrixon.com>

Public Instance Methods

update(time, result, ex) click to toggle source

Runs every time the {Manager} executes the TimerTask

used for logging information about the reaping

@param [Time] time the time of the execution @param [Object] result the result of the execution @param [Exception] ex any error raised from the TimerTask

@return [<type>] <description>

# File lib/sidekiq_unique_jobs/orphans/observer.rb, line 30
def update(time, result, ex)
  if result
    log_info("(#{time}) Execution successfully returned #{result}")
  elsif ex.is_a?(Concurrent::TimeoutError)
    log_warn("(#{time}) Execution timed out")
  else
    log_info("(#{time}) Cleanup failed with error #{ex.message}")
    log_error(ex)
  end
end