resque / resque/resque-pool

options to skip rakefile

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

Nobody has claimed this yet.

feature-request
Dominant language
Ruby
Stars
456
Forks
149
Avg merge
9d 7h
Merged PRs (30d)
3

Description

By default we load the rakefile and run the resque:pool rake task, because that follows the instructions in the resque README. We can also provide the ability to run Resque::Pool.run directly, from inside the resque-pool daemonizing script.

--init, -i <s>: Preload ruby script to initialize resque-pool
     --no-rake: Run without loading Rakefile or resque:pool task

to be run like so:
resque-pool -d -e production -i config/resque-pool-init.rb --no-rake

and config/resque-pool-init.rb might look like so:
require File.expand_path('environment', File.dirname(FILE))
# setup resque failure backend
# close any sockets or files in pool master
ActiveRecord::Base.connection.disconnect!
# and re-open them in the resque worker parent
Resque::Pool.after_prefork do |job|
ActiveRecord::Base.establish_connection
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 with the resque-pool daemonizing script and its existing --init handling. Trace how the Rakefile and resque:pool task are loaded, then verify that --no-rake can invoke Resque::Pool.run while an init script still loads and configures the environment.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.