Running Jobs More Frequently (Than Hourly) on Heroku
Heroku allows you to run cron jobs at most every hour. However, there are many tasks that need to be run more frequently than that. Solution? delayed_job; here’s how…
# Called by Heroku once per day (for free!)
task :cron => :environment do
# Runs this task every five minutes (24*60/5=288) using delayed_job
1.upto(288) do |run|
SomeModel.delay(:run_at => (run * 5).minutes.from_now).some_method
end
end
-
wonderingert liked this
-
flooringsex liked this
-
excitingex liked this
-
materialsex liked this
-
theresaup liked this
-
season303 liked this
-
resorts69 liked this
-
transactions0g2h liked this
-
jfoxny posted this