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

二次信任 提交于 2019-12-11 09:36:34

问题


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?


回答1:


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



来源:https://stackoverflow.com/questions/12428765/why-isnt-task-scheduler-working-but-running-rake-manually-working

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!