开发者

How to get working with hirefire for delayed_job in rails 3 in development?

开发者 https://www.devze.com 2023-04-11 12:52 出处:网络
I am developing an app with rails 3 开发者_运维百科using delayed_jobs. I\'m using Hirefire to scale up and down workers as and when needed. How can I get hirefire working in my development environment

I am developing an app with rails 3 开发者_运维百科using delayed_jobs. I'm using Hirefire to scale up and down workers as and when needed. How can I get hirefire working in my development environment, to test it is working as it is intended to.

Then how should I also configure it so it also works in my production environment in Heroku Cedar stack.


What you need to do is to set the environment to :local. By default it is set to :noop which does nothing. To do this, create a initializer for hirefire at Rails.root/config/initializers/hirefire.rb. In the initializer, add the following

HireFire.configure do |config|
  if Rails.env.production?
    config.environment = :heroku
   else
    config.environment = :local
  end
  # add any other configuration you want here
end
0

精彩评论

暂无评论...
验证码 换一张
取 消