“Whenever” gem running cron jobs on Heroku

后端 未结 3 2069
情话喂你
情话喂你 2020-12-04 19:35

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

3条回答
  •  感情败类
    2020-12-04 19:55

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

    Long answer: When you do heroku run, we

    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

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

提交回复
热议问题