HTTPException:等待来自URL的HTTP响应时超出了截止时间:#deadline [英] HTTPException: Deadline exceeded while waiting for HTTP response from URL: #deadline
问题描述
我们正在使用Python数据库2.15库的开发人员Python指南,以及针对应用程序引擎的示例。
createSite(test site one,description =test site one,source_site =( https://sites.google.com/feeds/site/googleappsforus.com/google-site-template ))
我们每次使用都会得到不可预知的反应。 例外::HTTPException:在等待来自网址的HTTP响应时超出了截止日期:https://sites.google.com/feeds/site/googleappsforyou.com
有人体验过同样的问题?它是AppEngine还是Sites API相关的?
问候,
在等待来自网址的HTTP响应时超过了截止时间实际上是一个 DeadlineExceededError 。当您发出HTTP请求时,App Engine会将此请求映射到URLFetch。 URLFetch具有可配置的截止日期。请参阅 URLFetch文档。
看起来您的客户端库捕获了DeadlineExceededError并引发了HTTPException。您的客户端库要么传递URLFetch的截止日期(您需要更改)或者默认截止日期不足以满足您的请求。
尝试设置默认URLFetch截止日期:
from google.appengine.api import urlfetch
urlfetch.set_default_fetch_deadline(45)
另外,请务必查看处理DeadlineExceededErrors 在官方文档中。
请记住,任何最终用户启动的请求必须在60秒内完成,否则将遇到DeadlineExceededError。请参阅 App Engine Python运行时请求计时器。
We are using the developers python guide with Python data 2.15 library and as per example stated for app engine. createSite("test site one", description="test site one", source_site =("https://sites.google.com/feeds/site/googleappsforus.com/google-site-template" ))
We are getting an un-predictable response every time we use.
Exception: HTTPException: Deadline exceeded while waiting for HTTP response from URL: https://sites.google.com/feeds/site/googleappsforyou.com
Did someone experience the same issue? Is it AppEngine or Sites API related?
Regards,
Deadline exceeded while waiting for HTTP response from URL is actually a DeadlineExceededError. When you are making a HTTP request, App Engine maps this request to URLFetch. URLFetch has its own deadline that is configurable. See the URLFetch documentation.
It seems that your client library catches DeadlineExceededError and throws HTTPException. Your client library either passes a deadline to URLFetch (which you would need to change) or the default deadline is insufficient for your request.
Try setting the default URLFetch deadline like this:
from google.appengine.api import urlfetch
urlfetch.set_default_fetch_deadline(45)
Also make sure to check out Dealing with DeadlineExceededErrors in the official Docs.
Keep in mind that any end-user initiated request must complete in 60 seconds or will encounter a DeadlineExceededError. See App Engine Python Runtime Request Timer.
这篇关于HTTPException:等待来自URL的HTTP响应时超出了截止时间:#deadline的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!