【发布时间】:2014-02-03 13:51:31
【问题描述】:
我正在 GAE 上运行一项每日报告任务,该任务最近使用了太多内存无法完成。因此,我想将其设置为后端任务。我已将后端设置如下:
backends:
- name: reporting
class: B4_1G
options: dynamic
start: reporting.app
在reporting.py 中定义了许多类,它们调用不同的报告。我的 cron.yaml 目前看起来像这样:
cron:
- description: update report 1
url: /reports/report1
schedule: every day 03:00
- description: update report 2
url: /reports/report2
schedule: every day 03:30
但是从逻辑上讲,这只是通过 app.yaml 调用前端实例上的作业,目前看起来像这样:
application: appname
version: 1
runtime: python27
api_version: 1
threadsafe: true
handlers:
- url: /(robots\.txt)
static_files: \1
upload: (robots\.txt)
- url: /favicon\.ico
static_files: favicon.ico
upload: favicon\.ico
- url: /sitemap\.xml
static_files: sitemap.xml
upload: sitemap\.xml
- url: /images
static_dir: images
- url: /js
static_dir: js
- url: /css
static_dir: css
- url: /reports/.*
script: reporting.app
login: admin
每天在后端实例上调用这些作业需要进行哪些更改?
【问题讨论】:
标签: python google-app-engine cron backend