How do I make heroku stop creating a web process for a worker-only app?
Asked Answered
B

1

6

I have a simple worker-only app that uses heroku's scheduler to run once per day. However I noticed that I was getting an extra run every time I pushed code and tracked it down to heroku creating a web process, running my worker command (twice!), and then declaring it "crashed" once my worker completes.

My Procfile only has one entry:

worker: npm start

But when I push to heroku, the logs include this little bit:

-----> Discovering process types
       Procfile declares types   -> worker
       Default types for Node.js -> web

What's going on here and how do I disable it?

You can see my complete code at https://github.com/nfriedly/vzw-bot and logs from a recent push at https://travis-ci.org/nfriedly/vzw-bot/builds/83548651

Blanketyblank answered 4/10, 2015 at 12:43 Comment(1)
See #40266199Conspire
B
6

I found a solution, running this will disable the default web worker:

heroku ps:scale web=0

The deploy logs still report the default web type, but it doesn't actually spin one up after that.

Blanketyblank answered 4/10, 2015 at 13:15 Comment(2)
This works, but... is there really no way to override the "default types for buildpack" so it doesn't do a web process at all?Contrition
I've raised an issue for it here: github.com/heroku/heroku-buildpack-nodejs/issues/335Playsuit

© 2022 - 2024 — McMap. All rights reserved.