是否可以增加Google App Engine中的响应超时时间? [英] Is it possible to increase the response timeout in Google App Engine?

查看:168
本文介绍了是否可以增加Google App Engine中的响应超时时间?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的本地机器上,脚本运行正常,但在云中它始终运行500次。这是一个cron任务,所以我不介意是否需要5分钟...



< class'google.appengine.runtime.DeadlineExceededError'>:



任何想法是否有可能增加超时?

感谢,
rui

解决方案

你不能超过30秒,但你可以通过使用任务间接增加超时队列和写作任务逐渐遍历数据集并对其进行处理。每个这样的任务运行当然应该适合超时限制。

编辑



更具体地说,您可以使用数据存储查询游标继续在同一地点处理:



http://code.google.com/intl/pl/appengine/docs/python/datastore/queriesandindexes.html#Query_Cursors



首先在SDK 1.3.1中引入: b
$ b

http://googleappengine.blogspot.com/2010/02/app-engine-sdk-131-including- major.html


On my local machine the script runs fine but in the cloud it 500 all the time. This is a cron task so I don't really mind if it takes 5min...

< class 'google.appengine.runtime.DeadlineExceededError' >:

Any idea whether it's possible to increase the timeout?

Thanks, rui

解决方案

You cannot go beyond 30 secs, but you can indirectly increase timeout by employing task queues - and writing task that gradually iterate through your data set and processes it. Each such task run should of course fit into timeout limit.

EDIT

To be more specific, you can use datastore query cursors to resume processing in the same place:

http://code.google.com/intl/pl/appengine/docs/python/datastore/queriesandindexes.html#Query_Cursors

introduced first in SDK 1.3.1:

http://googleappengine.blogspot.com/2010/02/app-engine-sdk-131-including-major.html

这篇关于是否可以增加Google App Engine中的响应超时时间?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆