Search code examples
node.jsherokuprocfile

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


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


Solution

  • 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.