resque / resque/resque-scheduler

How to configure Lock timeout

Open
#700 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Ruby
Stars
1.7k
Forks
477
PR merge metrics
No merged PRs in 30d

Description

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the build_master_lock entry point shown in the issue and read the Lock, Resilient, and Basic constructors to trace how timeout options are handled. Determine how the locking module could expose that configuration without source edits, then add coverage for the configured timeout if an existing lock test location is found. Done means users can change the timeout through the supported configuration path.

Written by the indexing model from the issue text.

Assessment

Tech stack
ruby
Domain
backend
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.