3

Is there a scheduling gem/app/add-on that works on both Heroku and my local machine? I just need to run a single task daily, so I don't think I need anything too complicated.

I've looked at Heroku's Scheduler, but it doesn't look like there's anything comparable locally for that. The whenever gem doesn't have anything comparable on Heroku ("Whenever" gem running cron jobs on Heroku.) I also looked at Resque/Resque Scheduler/Redis, but it really seems like overkill for what I want to do.

Am I missing something really basic here?

Community
  • 1
  • 1
rumblerob
  • 33
  • 3

3 Answers3

3

If you use the Heroku Scheduler on Heroku you can just use your locally crontab (assuming you're using OSX/Linux) to run things locally. All Heroku Scheduler is doing is executing a rake task at a given time, nothing too complicated in that.

John Beynon
  • 37,398
  • 8
  • 88
  • 97
2

rufus-scheduler works both locally or remotely on Heroku, ... with some limitations :

1) long-running job will be terminated: scheduled jobs are meant to execute short running tasks or enqueue longer running tasks into a background job queue such as Delayed Job. Anything that takes longer than a couple of minutes to complete should use a worker process to run ( see: heroku scheduler add-on )

2) you'll have to be careful about memory consumption. Each process has a 512 MB memory limit, after which it starts paging to swap and performance is degraded. If all of your threads combined use less than 512 MB of memory, then this might work.

Luca G. Soave
  • 12,271
  • 12
  • 58
  • 109
0

I am using the scheduler on heroku and things are working fine. If you want the same thing setup locally, you can just create cron task that just runs the rake task at the same iteration.

Chris Barretto
  • 9,379
  • 3
  • 42
  • 45