How do I make my cloud code run on my worker dyno instead of web dyno?

雨燕双飞 提交于 2019-12-19 11:47:26

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!