app/jobs/application_job.rb
# rescue_from doesn't catch Exceptions in jobs
rescue_from doesn't catch Exceptions in jobs
rescue_from doesn ' t catch Exceptions in jobs
def retry_on_term
    yield
  rescue Resque::TermException, Resque::DirtyExit
    Rails.logger.error("Performing #{self.class} was terminated. Retrying...")
    retry_job
  end
def retry_on_term yield rescue Resque :: TermException , Resque :: DirtyExit Rails . logger . error ( "Performing #{self.class} was terminated. Retrying..." ) retry_job end
rescue_from doesn't catch Exceptions in jobs
rescue_from doesn ' t catch Exceptions in jobs