Search code examples
ruby-on-railsrubydelayed-job

Number of delayed_job works on system reboot


I'm using the delayed_job Ruby gem just fine.

It defaults to a single worker, so I've gone ahead and done:

script/delayed_job stop
script/delayed_job -n 5 start

to ensure there are 5 workers.

However, when I reboot (or when the system decides to reboot), the Rails app boots back up with only a single delayed_job worker.

How can I change the default number of workers? It doesn't seem to be listed at https://github.com/collectiveidea/delayed_job.


Solution

  • It turns out the mechanism which ensured delayed_job started up on reboot was being controlled in my scenario by the 'whenever' gem's config/schedule.rb.

    The number of jobs may also change if you're using Capistrano with delayed_job recipes. You'll have to ensure the two numbers are shared correctly.