如何运行 Play!Heroku 的后台工作 [英] How to run Play! background jobs on Heroku
本文介绍了如何运行 Play!Heroku 的后台工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我很少在 Play 中使用 heroku!现在的应用程序,我是新手.我可以部署我的 Web 应用程序,但后台作业不运行.我尝试添加工人,但出现此错误:
I'm hardly using heroku for my Play! applications nowadays and I am new. I can deploy my web application but background jobs don't run. I tried to add worker but I got this error :
$ heroku scale worker=1
Scaling worker processes... ! No such type as worker
我创建了一个 Procfile 只包含
I created a Procfile includes just
web: play run --http.port=$PORT $PLAY_OPTS
仅用于网络,我找不到运行工作程序的表达式.如何在 Heroku 上运行我的后台作业?
It's just for web, I couldn't find expressions to run workers. How can I run my background jobs on Heroku?
推荐答案
你必须定义 worker 而不是 web:
You have to define the worker instead of web:
worker: play run --http.port=$PORT $PLAY_OPTS
这篇关于如何运行 Play!Heroku 的后台工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文