0

I want to create a task that run on every 2 hours from morning 8 to midnight. I have created task and tested locally , when i made a job through scheduler it just gives me three times daily , hourly and every 10 min. How can i customize it.

Hassan Munir
  • 419
  • 7
  • 24
  • How did you create your scheduler ? I am using the awesome whenever gem https://github.com/javan/whenever – theDrifter Aug 29 '16 at 12:59
  • I am not using any gem , i just wrote my task and now on heroku i created scheduler to add this task. There at scheduler i am just giving options of three times. – Hassan Munir Aug 29 '16 at 13:02

1 Answers1

0

You'll have to upgrade the Heroku Scheduler Add-On to make more precise settings. With the free dyno you can only choose between these 3.

The only way to achieve this would make these cron jobs from the framework itself. With a gem like https://github.com/jmettraux/rufus-scheduler

siegy22
  • 4,295
  • 3
  • 25
  • 43
  • Got it. But is there any other way to make it work by staying in free dyno. – Hassan Munir Aug 29 '16 at 13:03
  • @HassanMunir Please check my answer, there might actually be a solution to your problem – klaffenboeck Aug 29 '16 at 13:29
  • @klaffenboeck It's probably the same as `whenever`. you trigger the cron jobs from the framework and not from the system. – siegy22 Aug 29 '16 at 13:38
  • Well, according to @LucaG.Soave, it's a solution that's working on Heroku. I haven't looked into the sourcecode, but maybe it uses a different mechanism that's not dependent on a cron-job (maybe a parallel thread or something?) – klaffenboeck Aug 29 '16 at 13:41
  • Yeah I think so, but the idea is the same, that you start a job chronology from rails and not from the OS. – siegy22 Aug 29 '16 at 13:42
  • @RaVeN I am not saying that what you are saying is wrong, I am just saying that there might be a working solution for Heroku while staying in free dyno, according to HassanMunir 's first comment – klaffenboeck Aug 29 '16 at 13:47
  • Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/122110/discussion-between-klaffenboeck-and-raven). – klaffenboeck Aug 29 '16 at 13:59