Hi All,
I have a rails app hosted on Heroku which needs a regular task to run every 30 mintues. The task takes 5 minutes to complete
Previously I was using the gem resque and resque-scheduler for this. The problem however is that this requires 2 additional dynos, one for the scheduler and one for the worker task to run on.
Is there any way to achieve this just by using one dyno instead of two? Thanks in advance!
Thanks,
Ganesh
You could use the sucker punch gem which does the background processing
along with the rails process, so there shouldn't be the need to start
another dyno. Not sure about if we can schedule it to start at a particular
point of time.
Thanks..this seems to be a suitable gem for my purpose. The resque /
resque-scheduler was overkill since it was costing $70 a month just to run
simple scheduled tasks .
Btw, just curious. Cant we write cron jobs in heroku? Using something like
the whenever <https://github.com/javan/whenever> gem.
I am not sure conventional cron jobs can be made to work on heroku. There
is no persistent file storage so even if the crontab file is edited, it
wont reflect on any other dyno.
Thanks,
Ganesh
Ya it's wasteful to run a scheduler on it's own dyno all the time just to
schedule 1/2 tasks.
The sucker punch gem seems a good idea. I'll try it tonight..