必须在heroku上手动启动worker吗?
问题描述:
在我Procfile我有以下几点:必须在heroku上手动启动worker吗?
worker: cd appname && celery -A appname worker -l info --app=appname.celery_setup:app
然而,当我的应用程序提交它永远不会发生在一个任务,但我认为芹菜工人至少排序工作,因为
heroku logs --app appname
每隔一段时间给我的其中之一:
2016-07-22T07:53:21+00:00 app[heroku-redis]: source=REDIS sample#active-connections=14 sample#load-avg-1m=0.03 sample#load-avg-5m=0.09 sample#load-avg-15m=0.085 sample#read-iops=0 sample#write-iops=0 sample#memory-total=15664884.0kB sample#memory-free=13458244.0kB sample#memory-cached=187136kB sample#memory-redis=566800bytes sample#hit-rate=0.17778 sample#evicted-keys=0
此外,当我通过运行
0123开辟的bashheroku run bash --app appname
然后键入
cd appname && celery -A appname worker -l info --app=appname.celery_setup:app
它立刻告诉我已经接到任务,然后执行它。我希望发生这种情况,而不必手动登录并执行命令 - 这可能吗?我需要在heroku上有付费帐户吗?
答
我想通了。原来你也必须做
heroku ps:scale worker=1 --app appname
否则你不会真的在运行一个工人。