There was a proposal for an common queuing API for Rails, but was removed as of Rails 4 RC1 and will not be shipped with Rails 4 (FYI https://github.com/rails/rails/commit/f9da785d0b1b22317cfca25c15fb555e9016accb); so there is no change in term of code to user delayed_job
in Rails 4.
However, in Rails 4, the script
directory was renamed to bin
(to update run rake rails:update:bin
) so the command to run DelayedJob workers now is:
# Old
# RAILS_ENV=production script/delayed_job start
# RAILS_ENV=production script/delayed_job stop
# New
RAILS_ENV=production bin/delayed_job start
RAILS_ENV=production bin/delayed_job stop
If running from rake
, the command is not changed:
QUEUE=tracking rake jobs:work
QUEUES=mailers,tasks rake jobs:work
Capistrano config for delayed_job
in deploy.rb
should be changed:
require "delayed/recipes"
# set :delayed_job_command, "bundle exec ruby script/delayed_job"
set :delayed_job_command, "bundle exec ruby bin/delayed_job"
after "deploy:stop", "delayed_job:stop"
after "deploy:start", "delayed_job:start"
after "deploy:restart", "delayed_job:restart"