在Heroku上运行delayed_job worker? [英] Running delayed_job worker on Heroku?
问题描述
rake jobs:work
,它可以完美运行。 为了让delayed_job在heroku上工作,我一直使用几乎相同的命令: heroku运行rake作业:work
。这个解决方案的工作原理是,我不必为Heroku支付任何工人费用,但是我必须保持我的命令提示符窗口打开,否则delayed_job工作人员在关闭它时停止。即使关闭命令窗口,是否有一个命令可以永久保留delayed_job工作人员的工作?或者还有另一种更好的方法来解决这个问题?
worker:rake jobs:work
添加到您的 Procfile
。
编辑:
即使你从控制台运行它, '购买'工人dyno,但Heroku每秒钟都在堆放。所以你不支付,因为你有750小时免费,月最坏情况下有744小时,所以你有额外的dynos,调度任务等免费6小时。
So right now I have an implementation of delayed_job that works perfectly on my local development environment. In order to start the worker on my machine, I just run rake jobs:work
and it works perfectly.
To get delayed_job to work on heroku, I've been using pretty much the same command: heroku run rake jobs:work
. This solution works, without me having to pay anything for worker costs to Heroku, but I have to keep my command prompt window open or else the delayed_job worker stops when I close it. Is there a command to permanently keep this delayed_job worker working even when I close the command window? Or is there another better way to go about this?
Add
worker: rake jobs:work
to your Procfile
.
EDIT:
Even if you run it from your console you 'buy' worker dyno but Heroku has per second biling. So you don't pay because you have 750h free, and month in worst case has 744h, so you have free 6h for your extra dynos, scheduler tasks and so on.
这篇关于在Heroku上运行delayed_job worker?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!