简体   繁体   中英

alternative rake task to heroku worker?

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!

Use Heroku Scheduler addon. It can run your jobs every 10 minutes, every hour, or every day, at a specified time.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM