“无论何时"gem 在 Heroku 上运行 cron 作业 [英] "Whenever" gem running cron jobs on Heroku

查看:24
本文介绍了“无论何时"gem 在 Heroku 上运行 cron 作业的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了一个使用every gem 的应用程序.gem 创建 cron 工作.我让它在本地工作,但似乎无法让它在 heroku cedar 上工作.执行此操作的命令是什么?

I created an app that uses the whenever gem. The gem creates cron jobs. I got it working locally but can't seem to get it working on heroku cedar. What's the command to do this?

运行:

heroku run whenever --update-crontab job1

不起作用

推荐答案

简短回答:使用调度程序附加组件:http://addons.heroku.com/scheduler

Short answer: use the scheduler add-on: http://addons.heroku.com/scheduler

长答案:当你运行 heroku 时,我们

Long answer: When you do heroku run, we

  1. 启动测功机
  2. 把你的代码放在上面
  3. 执行你的命令,等待它完成
  4. 扔掉dyno

您对 crontab 所做的任何更改都会立即被丢弃.一切都是短暂的,您无法在 heroku 上编辑文件,只需推送新代码即可.

Any changes you made to crontab would be immediately thrown away. Everything is ephemeral, you cannot edit files on heroku, just push new code.

这篇关于“无论何时"gem 在 Heroku 上运行 cron 作业的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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