Kevin Kevin - 2 months ago 4x
Ruby Question

Running code repeatedly in Ruby on Rails with Heroku for an indefinite period

I am attempting to build a web application with Ruby on Rails that users site up for and get an email alert when a certain event happens.

As such, I need to be able to make an API call and then based on the JSON response, send the alert, but I need a way to have this API call happen repeatedly for an indefinite amount of time automatically. I am also using Heroku at this time if that needs to be taken into account.

Thanks for your help.


This sound like a cron job in plain old linux. Heroku calls this addon Scheduler. You have to define the task withing lib/tasks/scheduler.rake

For further information read the heroku docs for scheduler here