Python 为什么cron会失败?
因此,我有这两个cron作业(但正如您从屏幕上看到的,它们失败了,但我在日志中没有看到任何异常): 路由处理程序:Python 为什么cron会失败?,python,google-app-engine,Python,Google App Engine,因此,我有这两个cron作业(但正如您从屏幕上看到的,它们失败了,但我在日志中没有看到任何异常): 路由处理程序: app = webapp2.WSGIApplication([ ('/', MainHandler), ('/cron/addtask', AddTaskHandler), ('/cron/refreshInfo', RefreshHandler), ], debug=True) util.run_wsgi_app(app) application
app = webapp2.WSGIApplication([
('/', MainHandler),
('/cron/addtask', AddTaskHandler),
('/cron/refreshInfo', RefreshHandler),
], debug=True)
util.run_wsgi_app(app)
application: **********
version: 3
runtime: python27
api_version: 1
threadsafe: no
handlers:
- url: /static
static_dir: static
- url: /favicon\.ico
static_files: static/img/favicon.ico
upload: static/img/favicon\.ico
- url: /humans\.txt
static_files: static/txt/humans.txt
upload: static/txt/humans\.txt
- url: /robots\.txt
static_files: static/txt/robots.txt
upload: static/txt/robots\.txt
- url: /.*
script: main.py
- url: /tasks/popularityUpdate
script: main.py
- url: /tasks/Recalculation
script: main.py
- url: /tasks/weatherUpdate
script: main.py
- url: /cron/addtask
script: main.py
- url: /cron/refreshInfo
script: main.py
builtins:
- appstats: on
cron:
- description: addTaskToTheQueue
url: /cron/addtask
schedule: every 3 hours
- description: refreshInformation
url: /cron/refreshInfo
schedule: every 24 hours
APP.YAML:
app = webapp2.WSGIApplication([
('/', MainHandler),
('/cron/addtask', AddTaskHandler),
('/cron/refreshInfo', RefreshHandler),
], debug=True)
util.run_wsgi_app(app)
application: **********
version: 3
runtime: python27
api_version: 1
threadsafe: no
handlers:
- url: /static
static_dir: static
- url: /favicon\.ico
static_files: static/img/favicon.ico
upload: static/img/favicon\.ico
- url: /humans\.txt
static_files: static/txt/humans.txt
upload: static/txt/humans\.txt
- url: /robots\.txt
static_files: static/txt/robots.txt
upload: static/txt/robots\.txt
- url: /.*
script: main.py
- url: /tasks/popularityUpdate
script: main.py
- url: /tasks/Recalculation
script: main.py
- url: /tasks/weatherUpdate
script: main.py
- url: /cron/addtask
script: main.py
- url: /cron/refreshInfo
script: main.py
builtins:
- appstats: on
cron:
- description: addTaskToTheQueue
url: /cron/addtask
schedule: every 3 hours
- description: refreshInformation
url: /cron/refreshInfo
schedule: every 24 hours
CRON.YAML:
app = webapp2.WSGIApplication([
('/', MainHandler),
('/cron/addtask', AddTaskHandler),
('/cron/refreshInfo', RefreshHandler),
], debug=True)
util.run_wsgi_app(app)
application: **********
version: 3
runtime: python27
api_version: 1
threadsafe: no
handlers:
- url: /static
static_dir: static
- url: /favicon\.ico
static_files: static/img/favicon.ico
upload: static/img/favicon\.ico
- url: /humans\.txt
static_files: static/txt/humans.txt
upload: static/txt/humans\.txt
- url: /robots\.txt
static_files: static/txt/robots.txt
upload: static/txt/robots\.txt
- url: /.*
script: main.py
- url: /tasks/popularityUpdate
script: main.py
- url: /tasks/Recalculation
script: main.py
- url: /tasks/weatherUpdate
script: main.py
- url: /cron/addtask
script: main.py
- url: /cron/refreshInfo
script: main.py
builtins:
- appstats: on
cron:
- description: addTaskToTheQueue
url: /cron/addtask
schedule: every 3 hours
- description: refreshInformation
url: /cron/refreshInfo
schedule: every 24 hours
所以我的问题是-gae将其显示为失败的原因是什么
- 您可以访问添加到任务队列的URL(即/tasks/popularityUpdate)吗
- 当您手动输入cron作业url时,它是否执行了预期的操作
- 管理控制台中的日志没有显示任何错误(在cron请求上)
- 为什么在cron作业处理程序(
)的末尾有重定向?尝试删除它李>AddTaskHandler
…弗雷德里克1。我这样做了,但没有帮助。2.它在浏览器中工作,我被重定向到(/)3。向下滚动,你会看到路由:)@LukasŠalkauskas My bad,你能在末尾用/*发布更新app.yaml吗?重定向是个问题。