【发布时间】:2013-11-14 15:41:02
【问题描述】:
我正在尝试通过任务队列在 AppEngine 中执行一项任务,但我似乎仍然面临 60 秒的超时。我不确定自己做错了什么,因为我认为广告中的限制应该是 10 分钟。
我打电话给urlfetch.fetch(),这似乎是罪魁祸首。我的电话是:
urlfetch.fetch(url, payload=query_data, method=method, deadline=300)
我的堆栈跟踪的尾部显示了在 DeadlineExceededError 之前触发 url fetch 调用的方法:
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()
当我查看它显示的任务队列信息时:
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
处理任务的我的视图如下所示:
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 调用的方法。
有什么明显的我遗漏的东西使我被限制在 60 秒而不是 10 分钟?
【问题讨论】: