在 Heroku 上运行 Cron 任务 [英] Running Cron Tasks on Heroku

查看:36
本文介绍了在 Heroku 上运行 Cron 任务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经看到 Heroku 收取 15 美元/月的费用来运行延迟作业,每天 3 美元/月运行 cron 任务.是否可以完全跳过它并手动运行我自己的 cron 任务?还是他们以某种方式发现我正在运行 cron 任务?

I've seen that Heroku charges $15/mo to run Delayed Job, and $3/mo to run cron tasks daily. Is it possible to skip that entirely and run my own cron tasks manually? Or are they somehow figuring out that I'm running cron tasks?

推荐答案

我不完全确定您所说的手动运行我自己的 cron 任务"是什么意思.对于 cron,您需要访问他们可以控制的 crontab,因为他们是他们的服务器.如果您有其他方法,那可能没问题,但请记住,在 Heroku 下运行时,您的应用程序并未绑定到特定服务器,并且服务器在两次执行之间更改.

I'm not entirely sure what you mean by "run my own cron tasks manually". For cron specifically, you need access to crontab, which they can control, as they're their servers. If you have another way of doing it, it would probably be fine, but bear in mind that your app is not tied to a specific server when running under Heroku, and that the server will change between executions.

此外,除非他们自我上次检查以来对其进行了更改,否则您可以免费运行每日 cron 任务,但每小时收费 3 美元/月.

Also, unless they've changed it since last time I checked, you can run daily cron tasks for free, but hourly costs $3/mo.

编辑:是的,每日定时任务是免费的.请参阅 http://addons.heroku.com/.

EDIT: Yes, daily crons are free. See http://addons.heroku.com/.

这篇关于在 Heroku 上运行 Cron 任务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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