Heroku 调度程序:关于如何调试有什么想法吗?
我正在尝试转向 Heroku Scheduler 插件(博客文章:http://blog.heroku.com/archives/2011/11/12/heroku_scheduler_add_on_now_available/ ,开发中心:http://devcenter.heroku.com/articles/scheduler )
Rails 3.1 应用程序。我在 lib/tasks 中设置了 Scheduler.rake 文件,如果运行:
heroku rake processtats_main
我的进程运行完美。
在调度程序插件仪表板中,我添加了
rake processtats_main
并将其设置为 10 分钟(通常它是每小时运行的任务,但这只是为了测试),并且在 Web ui 中,它每十分钟更新一次上次运行时间,但它不是运行任务,或者运行任务以某种方式失败。
我无法点击“运行”按钮来运行它,它建议我通过命令行来执行它(是通过运行上面的 heroku rake 命令吗?因为效果很好)。令人沮丧的是,在“运行”单击失败后刷新页面后,“上次运行时间”会更新。如果您设置名为“diofgjsfdoigjsdi”的任务并单击运行,则上次运行时间将会更新,大概是因为调度程序可用于执行任何类型的命令,因此它正在尝试。但不会记录任何失败情况,因此,如果我认为语法正确,我不知道如何调试。
仪表板上没有任务输出。
日志中没有任何内容表明任何工作进程或其他任何内容。根本没有日志活动。 (不是一个实时应用程序,所以如果我不访问它,任何地方的人都不太可能会访问它。)我的 rake 任务看起来像这样:
task :processtats_main => :environment do
puts "Begin Widget.statsUpdate(1)"
Widget.statsUpdate(1)
puts "Widget.statsUpdate(1) done."
end
所以它至少应该将“puts”消息扔到日志中。
我禁用了 cron 插件,以防万一它以某种方式干扰。
如果我运行 heroku ps,我看不到与我的工作相关的进程。
有什么想法吗?我只是没有看到任何明显的下一步尝试。
I'm trying to move to the Heroku Scheduler addon, (blog post: http://blog.heroku.com/archives/2011/11/12/heroku_scheduler_add_on_now_available/ , dev centre: http://devcenter.heroku.com/articles/scheduler )
Rails 3.1 app. I setup the scheduler.rake file in lib/tasks and if I run:
heroku rake processtats_main
my process runs perfectly.
In the scheduler addon dashboard I've added
rake processtats_main
and set it to 10 minutes (normally it would be an hourly run task but this is just for testing), and in the web ui it's updating with the last run time every ten minutes but it's not running the task, or running the task is failing in some way.
I can't run it hitting the 'Run' button, it suggests I do it via the command line (is that by running the heroku rake command above? Because that works fine). Frustratingly, after I refresh the page after the failed 'run' click, the Last run time updates. The last run time will update if you setup a task called 'diofgjsfdoigjsdi' and click run, presumably because the scheduler can be used to execute any kind of command, so it's making an attempt. But nothing gets logged for failure, so if I think I have my syntax correct, I'm not sure how to debug.
There is no task output on the dashboard.
There is nothing in the logs to indicate any worker processes or anything else. There is no log activity at all. (Not a live app, so if I don't access it, it's unlikely anyone anywhere will.) My rake task looks like this:
task :processtats_main => :environment do
puts "Begin Widget.statsUpdate(1)"
Widget.statsUpdate(1)
puts "Widget.statsUpdate(1) done."
end
So it should throw at least the 'puts' messaging into the logs at the very least.
I disabled the cron addon just in case that was interfering in some way.
If I run heroku ps I see no processes related to my jobs.
Any ideas? I'm just not seeing anything obvious to attempt next.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我昨天遇到了完全相同的问题,并用 Heroku 记录了它,我刚刚收到回复;
查看我的日志,它看起来确实正在工作 - 除了在计划页面上单击“运行”仍然错误,但我有我希望现在运行的作业的历史条目。
I've had exactly the same problem yesterday and logged it with Heroku, I've just received a response;
Looking at my logs it definitely looks like it's working - except clicking RUN on the schedule page still errors but I have historical entries for jobs I would have expected to run showing now.