我正在尝试移植到 google app engine 模块,这是一项以前长期运行的工作(在“后端”中运行)。
下面是一个示例 module1.yaml。
application: myuniqueapp
module: module1
version: 1
runtime: python27
api_version: 1
threadsafe: true
instance_class: F4_1G
automatic_scaling:
max_idle_instances: 1
handlers:
- url: /data
static_dir: data
application_readable: true
- url: /.*
script: app.application
通过任务队列提交给这个(从前端实例)的代码是这样的:
taskqueue.add(url='/tasks/do_my_task',
target='1.module1')
这会毫无问题地提交正确的任务。该任务也由 module1 执行。
但它会在第 10 分钟被终止,并出现 DeadlineExceededError。这是一项长时间运行的任务,运行时间超过 10 分钟(就像它过去在“后端”中的工作方式一样)。
要使模块中执行的任务 > 10 分钟,需要进行哪些配置更改?
最佳答案
您只需为您的模块选择手动或基本缩放:
https://developers.google.com/appengine/docs/java/modules/#Java_Instance_scaling_and_class
关于python - 谷歌应用引擎模块 - 长时间运行的任务 > 10 分钟,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21959092/