Class: Sidekiq::Job::InterruptHandler

Inherits:
Object
  • Object
show all
Includes:
ServerMiddleware
Defined in:
lib/sidekiq/job/interrupt_handler.rb

Instance Attribute Summary

Attributes included from ServerMiddleware

#config

Instance Method Summary collapse

Methods included from ServerMiddleware

#logger, #redis, #redis_pool

Instance Method Details

#call(instance, hash, queue) ⇒ Object



8
9
10
11
12
13
14
15
# File 'lib/sidekiq/job/interrupt_handler.rb', line 8

def call(instance, hash, queue)
  yield
rescue Interrupted
  logger.debug "Interrupted, re-queueing..."
  c = Sidekiq::Client.new
  c.push(hash)
  raise Sidekiq::JobRetry::Skip
end