2011-10-09 65 views
2

我开发使用delayed_jobs轨3的应用程序。我正在使用Hirefire在需要时扩大和缩小工作人员。我如何在我的开发环境中使用hirefire工作,来测试它是否按照预期工作。如何获得在发展的轨道3 hirefire工作的delayed_job?

那么应该怎么还配置它,它也可以在我的生产环境中的Heroku雪松堆栈。

回答

5

你需要做的是设置environment:local。默认情况下,它设置为:noop,它什么都不做。要做到这一点,在Rails.root/config/initializers/hirefire.rb创建hirefire一个初始化。在初始化,添加以下

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