工作不是使用hirefire在heroku上解雇 [英] jobs is not firing on heroku using hirefire

查看:108
本文介绍了工作不是使用hirefire在heroku上解雇的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在将宝石"delayed_job_active_record"与heroku一起使用,以在后台运行作业.我还使用myoku帐户设置了heroku环境变量.我在gem文件中的序列在下面

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'

它也在开发和生产的本地环境中工作.但是作业没有从延迟的作业表中触发.首先,我尝试在Intilizer中没有配置文件hirefire.rb,但没有成功.在我添加并将此代码放在下面之后.

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

但没有成功.尽管还雇用了hirefire,但也请参见下面的屏幕截图

but no success. Although hirefire is also loading see screen shot below also

推荐答案

可能不应该在那里检查Rails.env.production?并将其放在config/environments/production.rb中.

Should probably not be doing check for Rails.env.production? there and put that in config/environments/production.rb instead.

要了解如何在Heroku中设置delay_job_active_record,请阅读以下内容: https://devcenter.heroku. com/articles/delayed-job

To see how to setup delayed_job_active_record in Heroku, read this: https://devcenter.heroku.com/articles/delayed-job

这篇关于工作不是使用hirefire在heroku上解雇的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆