Search code examples
herokurakescheduler

Why isn't task scheduler working but running rake manually working


I have an app running on heroku and once an hour I need to run a rake task called get_instagram_photos. I am scraping instagram and then adding the info to the database. If I run the following manually in terminal the task works great.

$> heroku run rake get_instagram_photos

I am using the new scheduler addon that heroku implemented. I added get_instagram_photos as one of the tasks that I would like to run once an hour. The dashboard seems to tell me that it runs once an hour however I don't see any data being added to the database. I am 100% sure the task works it just seem that something is amiss when I allow scheduler to run it.

How should I begin to trouble shoot this?


Solution

  • You actually need to add rake get_instagram_photos (Looks like you forgot the rake) to your scheduler addon.

    You can find more info in the Scheduler doc: https://devcenter.heroku.com/articles/scheduler