Heroku and node-cron?

岁酱吖の 提交于 2019-12-03 13:51:26

问题


So I know Heroku's free dynos 'wind down' when there isn't any traffic to them– how would this effect the cron jobs that I've implemented using the node-cron module?


回答1:


Jobs scheduled by node_cron won't run when your free dynos are sleeping.

As an alternative, you can use the Heroku Scheduler add-on to schedule your cron jobs. That will trigger one-off dynos to run your cron jobs. Provided you don't exceed your monthly allowance of free dyno hours, you will be able to run your cron jobs for free.




回答2:


Probably they won't work as you expect in 100%. I mean, if cron execution will be scheduled at the time when your server would be offline, then it won't work. Hobby Dynos on Heroku power-up only at HTTP request and shutdown after some period of inactivity, they won't boot because of cron.



来源:https://stackoverflow.com/questions/39057883/heroku-and-node-cron

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