[英]I've made a correct Procfile but I dont see a worker dyno in the dashboard
我试图将一个非常简单的机器人部署到 heroku,但我无法设置 worker dyno,因为它没有显示在仪表板上,即使我有一个只有一行的 Procfile:worker: node app.js
Same issue, I resolved it from Heroku documentation :同样的问题,我从 Heroku 文档中解决了它:
Scaling a process type Heroku runs one web
dyno for you automatically, but other process types don't start by default.扩展进程类型 Heroku 会自动为您运行一个
web
dyno,但默认情况下不会启动其他进程类型。 To launch a worker, you need to scale it up to one dyno:要启动一个工作程序,您需要将其扩展到一个 dyno:
heroku ps:scale worker=1
Scaling worker processes... done, now running 1
I had the same issue, correct code but worker didn't appear.我有同样的问题,正确的代码,但没有出现工人。 For me, the issue was that my Procfile was named "procfile" and not "Procfile"
对我来说,问题是我的 Procfile 被命名为“procfile”而不是“Procfile”
So the issue was that Heroku only builds off the master branch and I was developing on a different branch.所以问题是 Heroku 只建立在 master 分支上,而我在不同的分支上开发。 I solved this by assigning my current branch as the master branch
git push heroku YourDifferentBranchHere:master
我通过将我当前的分支分配为主分支来解决这个问题
git push heroku YourDifferentBranchHere:master
The issue was easily solved for me once I changed the procfile
name to Procfile
.这个问题很容易解决了我一次,我改变了
procfile
名Procfile
。 After this I wrote the following code:在此之后,我编写了以下代码:
worker: node bot.js
$ heroku ps:scale web=1 worker=5
heroku ps:scale web=1 worker=5
Then I refreshed the page, it worked perfectly for me.然后我刷新了页面,它非常适合我。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.