class Litejob::Processor

def process!

Experimental RBS support (using type sampling data from the type_fusion project).

def process!: () -> true?

This signature was generated using 26 samples from 1 application.

def process!
  log(:deq)
  klass = Object.const_get(@job_hash["class"])
  instance = klass.new
  begin
    instance.perform(*@job_hash["params"])
    log(:end)
  rescue => e
    if @job_hash["retries_left"] == 0
      err(e, "retries exhausted, moving to _dead queue")
      repush(@id, @job_hash, 0, "_dead")
    else
      @job_hash["retries_left"] ||= @job_hash["attempts"]
      @job_hash["retries_left"] -= 1
      retry_delay = (@job_hash["attempts"] - @job_hash["retries_left"]) * 0.1
      err(e, "retrying in #{retry_delay} seconds")
      repush(@id, @job_hash, retry_delay, @job_hash["queue"])
    end
  end
rescue => e
  # this is an error in the extraction of job info, retrying here will not be useful
  err(e, "while processing job=#{@serialized_job}")
  raise e
end