My delayed job is not working. I am trying to create an background task for a rake file using a delayed job that should run every 15 minute. I have copied my rake tasks in m
If you just want to run code every X minute/hour, than you don't need delayed_job for that. That would be kind of overkill and over engineered. Just use this code here:
until 2 < 1 do
if Time.now.min % 15 == 0
puts "Execute your code here!"
if Time.now.min % 15 == 0
sleep(60)
end
end
end
Put the code into Rakefile, make a task out of it and deploy it on a heroku worker dyno. That will work. Here is a complete tutorial for that: http://robert-reiz.com/2012/06/12/cron-jobs-on-heroku/.
For that solution you even don't need Herokus Cron or Scheduler Add-On. And you don't need any additional GEMs like delayed_job. Pragmatic solution. Keep it slim ;-)