English 中文(简体)
死亡期限 谷歌应用引擎的傲慢例外
原标题:When can DeadlineExceededError exception be thrown in Google App Engine

我撰写了一份推迟的任务,目的是在博龙店建立一个档案供下载。 我正在对《手册》中给出的例子进行建模:

rel=“nofollow” http://code.google.com/appengine/articles/defered.html

设想是制定该守则,以便如果存在一条死线外逃,则手ler者可以ti忙,放弃新的延期任务,随后继续。

What I d like to know is when exactly can this exception be thrown? Are there any operations which are guaranteed to be atomic and therefore will not be interrupted?

例如(见上文)它们更新了一个称为“开端”的变数——即完成处理每一记录时的关键,但说,在把投到“投向”和“替代名单”之间中断了主旋余地,因此数据是错误的,因为它会错失一套删除。

如果在任何时候可以提出例外情形,则该例外可能会在批量-货物之间,或者在批量和向投递清单之间半途。

从逻辑上讲,这相当于一个可怕的安全问题,为了解决这个问题,通常保证了原子操作和非生物作业。

这项工作如何?

增 编

最佳回答

A DeadlineExceededError can be thrown literally any time at all. If there were a time when it couldn t be thrown, an abusive app could simply execute that code in a loop.

You can avoid this several ways:

  1. Proactively check how long you ve been executing for and stop at a good time before you hit the deadline.
  2. Put the exception handler somewhere that it can store the state as of the last set of completed operations (eg, discarding anything since the last iteration of the outer loop in which the exception was thrown)
  3. Use backends, which do not have deadlines.
问题回答

暂无回答




相关问题
Can Django models use MySQL functions?

Is there a way to force Django models to pass a field to a MySQL function every time the model data is read or loaded? To clarify what I mean in SQL, I want the Django model to produce something like ...

An enterprise scheduler for python (like quartz)

I am looking for an enterprise tasks scheduler for python, like quartz is for Java. Requirements: Persistent: if the process restarts or the machine restarts, then all the jobs must stay there and ...

How to remove unique, then duplicate dictionaries in a list?

Given the following list that contains some duplicate and some unique dictionaries, what is the best method to remove unique dictionaries first, then reduce the duplicate dictionaries to single ...

What is suggested seed value to use with random.seed()?

Simple enough question: I m using python random module to generate random integers. I want to know what is the suggested value to use with the random.seed() function? Currently I am letting this ...

How can I make the PyDev editor selectively ignore errors?

I m using PyDev under Eclipse to write some Jython code. I ve got numerous instances where I need to do something like this: import com.work.project.component.client.Interface.ISubInterface as ...

How do I profile `paster serve` s startup time?

Python s paster serve app.ini is taking longer than I would like to be ready for the first request. I know how to profile requests with middleware, but how do I profile the initialization time? I ...

Pragmatically adding give-aways/freebies to an online store

Our business currently has an online store and recently we ve been offering free specials to our customers. Right now, we simply display the special and give the buyer a notice stating we will add the ...

Converting Dictionary to List? [duplicate]

I m trying to convert a Python dictionary into a Python list, in order to perform some calculations. #My dictionary dict = {} dict[ Capital ]="London" dict[ Food ]="Fish&Chips" dict[ 2012 ]="...

热门标签