gpt4 book ai didi

google-app-engine - 异常 : Deadline exceeded while waiting for HTTP response from URL: #deadline

转载 作者:太空宇宙 更新时间:2023-11-03 15:18:27 25 4
gpt4 key购买 nike

我们正在使用开发人员 python 指南和 Python 数据 2.15 库,并按照应用引擎的示例进行说明。createSite("测试站点一", description="测试站点一", source_site =("https://sites.google.com/feeds/site/googleappsforus.com/google-site-template "))

我们每次使用时都会收到无法预测的响应。

异常: HTTPException:WAITING来自 URL 的 HTTP 响应时超出截止日期:https://sites.google.com/feeds/site/googleappsforyou.com

有人遇到同样的问题吗?与 AppEngine 或 Sites API 相关吗?

问候,

最佳答案

在等待来自 URL 的 HTTP 响应时超出截止时间 实际上是一个 DeadlineExceededError。当您发出 HTTP 请求时,App Engine 会将此请求映射到 URLFetch。 URLFetch 有自己的可配置截止日期。查看URLFetch documentation .

您的客户端库似乎捕获了 DeadlineExceededError 并抛出了 HTTPException。您的客户端库要么将截止日期传递给 URLFetch(您需要更改),要么默认截止日期不足以满足您的请求。

尝试像这样设置默认的 URLFetch 截止时间:

from google.appengine.api import urlfetch
urlfetch.set_default_fetch_deadline(45)

另请务必查看 Dealing with DeadlineExceededErrors在官方文档中。

请记住,任何最终用户发起的请求都必须在 60 秒内完成,否则将遇到 DeadlineExceededError。参见 App Engine Python Runtime Request Timer .

关于google-app-engine - 异常 : Deadline exceeded while waiting for HTTP response from URL: #deadline,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14698119/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com