“每当” gem运行cron工作在Heroku [英] "Whenever" gem running cron jobs on Heroku

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

问题描述

我创建了一个使用whatever gem的应用程序。宝石创建cron工作。我得到它在本地工作,但似乎不能让它工作在heroku雪松。

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 / schedule

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. 抛出动力

  1. spin up a dyno
  2. put your code on it
  3. execute your command, wait for it to finish
  4. throw the dyno away

您对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运行cron工作在Heroku的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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