问题
I have a parse server deployed on heroku. I am running some cloud code on my parse server its a code that takes several minutes to run and causes timeout errors on Heroku when run on a web dyno.
heroku[router]: at=error code=H12 desc="Request timeout" method=POST path="/parse/functions/timeScore
My understanding is if I can make the cloud code run on a worker dyno there won't be any timeout error. Is this correct?
So now I have a web and worker dyno running on my app.
And here is my Procfile
web: node index.js
worker: node bin/timeScoreJob
Is there anything else I need to do to run the cloud code on the worker dyno? As it currently does not run on the worker dyno. It runs on the web dyno as seen from the heroic logs when the code is running and I still get the timeout errors.
Here is how I run the cloud code from my terminal
heroku run node bin/timeScoreJob
What am I doing wrong? Why is my code not running on the worker dyno?
来源:https://stackoverflow.com/questions/51118741/how-do-i-make-my-cloud-code-run-on-my-worker-dyno-instead-of-web-dyno