class Delayed::FailSafe::ClearLocks

Public Class Methods

call(worker) click to toggle source
# File lib/delayed/fail_safe/clear_locks.rb, line 20
def self.call(worker)
  Delayed::Job.clear_locks!(worker.name)
rescue => ex
  @@exception_handler.call(ex, worker)
end
exception_handler(&block) click to toggle source

Allow user customizations of error handling.

To get the same behavior as `Delayed::Plugins::ClearLocks` :

Delayed::FailSafe::ClearLocks.exception_handler { |ex| raise(ex) }
# File lib/delayed/fail_safe/clear_locks.rb, line 15
def self.exception_handler(&block)
  return @@exception_handler unless block_given?
  @@exception_handler = block
end