resque-scheduler icon indicating copy to clipboard operation
resque-scheduler copied to clipboard

How to configure Lock timeout

Open allensds opened this issue 4 years ago • 0 comments

Hi,

The base class of the Lock constructor suggests the timeout is configurable:

@timeout = options[:timeout] || 60 * 3

However, in the locking module, there is no way to put in the options with code like this. How do we easily change the configuration without changing the source code?

 def build_master_lock
    if supports_lua?
      Resque::Scheduler::Lock::Resilient.new(master_lock_key)
    else
      Resque::Scheduler::Lock::Basic.new(master_lock_key)
    end
  end

allensds avatar Jul 06 '20 04:07 allensds