lib/resque/worker.rb
# Processes a given job in the child.
Processes a given job in the child.
Processes a given job in the child .
def perform(job)
      begin
        @current_job = job
        run_hook :after_fork, job
        job.perform
      rescue Object => e
        log "#{job.inspect} failed: #{e.inspect}"
        begin
          job.fail(e)
        rescue Object => e
          log "Received exception when reporting failure: #{e.inspect}"
        end
        Stat << "failed"
      else
        log "done: #{job.inspect}"
      ensure
        @current_job = nil
        yield job if block_given?
      end
    end
def perform ( job ) begin @current_job = job run_hook :after_fork , job job . perform rescue Object => e log "#{job.inspect} failed: #{e.inspect}" begin job . fail ( e ) rescue Object => e log "Received exception when reporting failure: #{e.inspect}" end Stat << "failed" else log "done: #{job.inspect}" ensure @current_job = nil yield job if block_given? end end
Processes a given job in the child.
Processes a given job in the child .
job