Class: Sidekiq::Rescue::ServerMiddleware Private

Inherits:
Object
  • Object
show all
Includes:
ServerMiddleware
Defined in:
lib/sidekiq/rescue/server_middleware.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Server middleware for sidekiq-rescue It is responsible for catching the errors and rescheduling the job according to the options provided

Instance Method Summary collapse

Instance Method Details

#call(job_instance, job_payload, _queue) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



12
13
14
15
16
17
18
19
# File 'lib/sidekiq/rescue/server_middleware.rb', line 12

def call(job_instance, job_payload, _queue, &)
  job_class = job_instance.class
  if job_class.respond_to?(:sidekiq_rescue_options) && !job_class.sidekiq_rescue_options.nil?
    sidekiq_rescue(job_payload, job_class, &)
  else
    yield
  end
end