【问题标题】:Cron.yaml doesn't route requests to proper module on dev serverCron.yaml 不会将请求路由到开发服务器上的正确模块
【发布时间】:2014-05-20 10:26:11
【问题描述】:

我使用的是 GAE 1.9.2 —— 我有一个 cron.yaml 文件,其中包含我想要路由到名为 updater.yaml 的模块的特定请求。在我的 cron.yaml 文件中,我有:

cron:
- description: Daily updater
  url: /update
  schedule: every day 02:00
  timezone: America/New_York
  target: updater

我将我的两个模块加载到我的开发服务器:

$ dev_appserver.py app.yaml updater.yaml 

有什么想法吗?谢谢。

编辑

updater.yaml 的相关部分:

application: [my app name]
module: updater
version: one
runtime: python27
api_version: 1
threadsafe: true
instance_class: B4_1G
basic_scaling:
  max_instances: 1

handlers:
- url: /update
  script: downloader.application
  login: admin

编辑 2

当我托管在 google 上时(即未在我的 dev_server 上运行)时,我在我的应用程序上收到此错误,因此似乎处理程序没有正确设置...?:

W 2014-04-08 02:00:02.687 No handlers matched this URL.

【问题讨论】:

  • 你得到错误还是什么?
  • 在开发控制台中单击“立即运行”时出现 404 错误。我猜这是因为 app.yaml 没有 /update url 处理程序,但 updater.yaml 有..
  • 你有两个模块显示在 localhost:8000 中吗? developers.google.com/appengine/docs/python/modules/routing
  • 是的——我需要对 dispatch.yaml 做些什么吗?我在之前的帖子中添加了 updater.yaml 的相关部分。
  • 是的,我认为您需要指定调度程序。查看此帖子以获取更多信息stackoverflow.com/questions/18523234/…

标签: python google-app-engine cron


【解决方案1】:

从您的错误消息来看,更新程序模块似乎没有正确映射处理程序。确保您可以在浏览器中手动调用 /update url 并获得正确的日志输出。

我现在将 cron.yaml 与生产中的目标模块一起使用。该模块没有 dispatch.yaml 条目。

【讨论】:

    猜你喜欢
    • 2021-02-13
    • 1970-01-01
    • 1970-01-01
    • 2020-09-23
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-05-06
    相关资源
    最近更新 更多