带有任务队列的AppEngine超时 [英] AppEngine Timeout with Task Queues

查看:102
本文介绍了带有任务队列的AppEngine超时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图通过任务队列在AppEngine中执行任务,但我似乎仍然面临60秒的超时。我不确定我做错了什么,因为我认为这应该是10分钟的广告。

I'm trying to execute a task in AppEngine through the Task Queues, but I still seem to be faced with a 60 second timeout. I'm unsure what I'm doing incorrectly, as the limit I'd think should be 10 minutes as advertised.

我打电话给 urlfetch.fetch()看起来是罪魁祸首。我的电话是:

I have a call to urlfetch.fetch() that appears to be the culprit. My call is:

urlfetch.fetch(url, payload=query_data, method=method, deadline=300)

我的堆栈跟踪的尾端显示了在之前触发url抓取调用的方法, DeadlineExceededError

The tail end of my stack trace shows the method that triggers the url fetch call right before the DeadlineExceededError:

File "/base/data/home/apps/s~mips-conversion-scheduler/000-11.371629749593131630/views.py", line 81, in _get_mips_updated_data
policies_changed = InquiryClient().get_changed_policies(company_id, initial=initial).json()

当我查看任务队列信息时,它显示:

When I look at the task queue information it shows:

Method/URL: POST /tasks/queue-initial-load
Dispatched time (UTC): 2013/11/14 15:18:49
Seconds late: 0.18
Seconds to process task: 59.90
Last http response code: 500
Reason to rety: AppError

处理任务的My View看起来像:

My View that processes the task looks like:

class QueueInitialLoad(webapp2.RequestHandler):
def post(self):
    company = self.request.get("company")
    if company:
        company_id = self.request.get("company")
        queue_policy_load(company_id, queue_name="initialLoad", initial=True)

用queue_policy_load是触发urlfetch调用的方法。

with the queue_policy_load being the method that triggers the urlfetch call.

有没有什么明显的我错过了,这使我仅限于60秒超时而不是10分钟?

Is there something obvious I'm missing that makes me limited to the 60 second timeout instead of 10 minutes?

推荐答案

任务队列有10分钟截止日期,但Urlfetch调用的截止时间为1分钟:

The task queues have a 10min deadline but a Urlfetch call has a 1 min deadline :

最长截止日期(请求处理程序)60秒

更新:预期的行为是在TaskQueue中运行时最多有10分钟的URLFetch截止日期,请参阅 bug

UPDATE: the intended behaviour was to have a max of 10mins URLFetch deadline when running in a TaskQueue, see this bug.

这篇关于带有任务队列的AppEngine超时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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