I'm trying to run a Worker process on Heroku with NO web process.
It is a small node express app. But it does not work unless I have a web process running.
I have a Procfile with
worker node server.js
But I get this error
heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/
I want to run it as a worker process as workers are not restricted to the 30s timeout and should be more efficient. This endpoint is meant to just process 1 intensive task separate from our main API so it makes sense to be setup as a worker.
As per this
https://help.heroku.com/PFSOIDTR/why-am-i-seeing-h12-request-timeouts-high-response-times-in-my-app
Question 2: Have I delegated long-running tasks as background jobs? If you cant make your code run any faster and you simply need more time (i.e. process images, parsing documents, making API calls, etc), you can run them as background jobs on worker dynos. Worker dynos do not face the same 30 second timeout that web dynos do, making them perfect for heavy lifting.
All issues I find on fixing this says scale to web:1
So this leads me to believe express cannot run as a worker only and must be a web process?