Even though offline requests can currently live up to 10 minutes (and
background instances can live forever) datastore queries can still
only live for 30 seconds. We plan to improve this, but since a
'consistent' view of the data is only preserved for a limit period of
time, there is an upper bound to how long a query can last (which is <
10 minutes).
。。。在
Instead of running a single long query, consider fetching batches from
the query using query cursors.
简单地为序列中的每个元素创建延迟任务。这里有一篇很好的文章,里面有一些例子说明如何正确地处理“Background work with the deferred library”。在
我编写了一个简单的helper来实现这一点—您可以使用batch_size、查询的对象类和处理查询中元素的回调来调用它。在
(注意,我使用的是djangoappengine,因此使用的是django查询格式,但是您可以根据需要修改它。)
此问题可能会对您的问题有所启示:https://code.google.com/p/googleappengine/issues/detail?id=4432
。。。在
相关问题 更多 >
编程相关推荐