【发布时间】:2012-04-10 03:57:18
【问题描述】:
我的环境是 rails 3.1,heroku 竹栈,delayed_job_active_record,(https://github.com/collectiveidea/delayed_job) 并尝试使用hirefire。 (https://github.com/meskyanichi/hirefire) - 我可以看到delayed_job 队列文档,但是如何在heroku 上应用它?
我有一组最高优先级的任务,这些任务每小时产生一次,我需要 3 名工人来完成,大约需要 26 分钟才能完成。在此期间,需要继续执行不太重要的后台任务,可能需要 1 名工作人员专门处理这些任务。
所以我将把优先任务块设置在一个命名队列中,例如'hourtask',然后为其他所有内容命名一个队列 'everythingelse' :)
问题是,如何将 heroku 工作人员专用于特定队列?根据文档,它与环境变量有关吗?它说:
# Set the --queue or --queues option to work from a particular queue.
$ RAILS_ENV=production script/delayed_job --queue=tracking start
$ RAILS_ENV=production script/delayed_job --queues=mailers,tasks start
但我对 heroku 设置不够熟悉,无法弄清楚如何将其应用于我的 heroku 生产环境?
【问题讨论】:
标签: ruby-on-rails heroku delayed-job