Heroku和node-cron? [英] Heroku and node-cron?

查看:141
本文介绍了Heroku和node-cron?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

因此,当没有任何流量通过它时,我知道Heroku的免费dynos'风向了' - 这将如何影响我使用node-cron模块实现的cron作业?

解决方案

作为替代方案,由node_cron调度的作业在您的免费试用版正在休眠时不会运行。 ,您可以使用 Heroku Scheduler加载项来安排您的cron作业。这将触发一次性的dynos来运行你的cron作业。如果您不超过每月免费测试小时的免费时间,您将可以免费运行您的cron作业。

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?

解决方案

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.

这篇关于Heroku和node-cron?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆