I have succesfully queued a job, which I can see in resque web.
But the job is never executeted, just pending. I have 1 worker on my heroku app. In resque stats the workers are 0.
In lib/tasks/resque.rb:
require 'resque/tasks'
task "resque:setup" => :environment do
ENV['QUEUE'] = '*'
Resque.after_fork do |job|
ActiveRecord::Base.establish_connection
end
end
desc "Alias for resque:work (To run workers on Heroku)"
task "jobs:work" => "resque:work"
You have to tell Heroku to start up your Resque workers via a Procfile. This is where you put the command you would run locally, like RAILS_ENV=Production QUEUE=* bundle exec rake jobs:work
This gives the added benefit of testing you Heroku Resque setup locally by using the same Profile to start Resque workers with Foreman.
Here is a link on the Heroku site that explains how to get that set up.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With