Reputation: 81
I'm trying to find a solution to run a background task on heroku every few hours, without the need to pay for an expensive worker.
So far, I have implemented a rails controller with a specific def which it invokes the job. So, whenever I hit the url, it runs normally. Now I'm trying to find a solution to hit this url every few hours.
Of course, I could run a cron task from another server with something like
/usr/bin/curl -s "http://url/of/hourly/task" > /dev/null
or simply use a webcron service, but I would like some more control.
I tried the whenever
gem https://github.com/javan/whenever on a second rails application, but I could not make it run properly. I'm new in ruby anyway.
Any suggestion? Thank you!
Upvotes: 0
Views: 400
Reputation: 8429
Use Heroku Scheduler
addon. It can run your jobs every 10 minutes, every hour, or every day, at a specified time.
Upvotes: 5