为什么不是任务调度程序工作,但运行耙子手动工作 [英] Why isn't task scheduler working but running rake manually working
问题描述
我有一个应用程序在heroku上运行,一小时一次,我需要运行一个名为get_instagram_photos的rake任务。我抓取instagram,然后将信息添加到数据库。如果我在终端中手动运行以下任务,那么这个任务很好。
$> heroku运行rake get_instagram_photos
我使用的是heroku实现的新调度器插件。我添加了get_instagram_photos作为我想每小时运行一次的任务之一。仪表板似乎告诉我,它每小时运行一次,但我没有看到任何数据被添加到数据库。当我允许调度程序运行它时,我100%确定该任务有效,似乎有什么不对劲。
我应该如何开始麻烦拍摄这张照片?
您实际上需要为您的调度程序插件添加 rake get_instagram_photos
(看起来您忘记了 rake
)。
您可以在计划程序文档中找到更多信息: https:// devcenter .heroku.com / articles / scheduler
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?
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
这篇关于为什么不是任务调度程序工作,但运行耙子手动工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!