问题
i'm using gem "delayed_job_active_record" with hire fire on heroku to run jobs in background.i have also set heroku envirnoment variable using my heroku account. My sequence in gem file is below
gem 'delayed_job_active_record'
gem 'daemons'
gem 'hirefire'
it is working in local envirnoment in development as production as well. But jobs not firing on heroku from delayed job table. First i try with no config file hirefire.rb in intilizer but no succes. After i add and put this code below.
HireFire.configure do |config|
if Rails.env.production?
config.max_workers = 5 # default is 1
config.min_workers = 0 # default is 0
config.job_worker_ratio = [
{:jobs => 1, :workers => 1},
{:jobs => 15, :workers => 2},
{:jobs => 35, :workers => 3},
{:jobs => 60, :workers => 4},
{:jobs => 80, :workers => 5}
]
end
end
but no success. Although hirefire is also loading see screen shot below also
回答1:
Should probably not be doing check for Rails.env.production?
there and put that in config/environments/production.rb
instead.
To see how to setup delayed_job_active_record in Heroku, read this: https://devcenter.heroku.com/articles/delayed-job
来源:https://stackoverflow.com/questions/14962993/jobs-is-not-firing-on-heroku-using-hirefire