【问题标题】:Appengine python The API call mail.Send() took too long to respond and was cancelledAppengine python API调用mail.Send()响应时间过长被取消
【发布时间】:2012-02-20 11:43:01
【问题描述】:

我们经常从我们的 appengine 应用程序收到此错误。其他人是否收到此错误?有谁知道如何解决它?

File "/base/python27_runtime/python27_lib/versions/1/google/appengine/api/mail.py", line 894, in send
  make_sync_call('mail', self._API_CALL, message, response)
File "/base/python27_runtime/python27_lib/versions/1/google/appengine/api/apiproxy_stub_map.py", line 94, in MakeSyncCall
return stubmap.MakeSyncCall(service, call, request, response)
File "/base/python27_runtime/python27_lib/versions/1/google/appengine/api/apiproxy_stub_map.py", line 308, in MakeSyncCall
rpc.CheckSuccess()
File "/base/python27_runtime/python27_lib/versions/1/google/appengine/api/apiproxy_rpc.py", line 133, in CheckSuccess
raise self.exception
DeadlineExceededError: The API call mail.Send() took too long to respond and was cancelled.

谢谢

【问题讨论】:

    标签: google-app-engine python-2.7


    【解决方案1】:

    我遇到了很多这样的错误(在 Python 2.5 上),我决定将 SendMail 调用移至任务。这样我至少每次失败时都会重试。

    【讨论】:

    • 谢谢你 - 我想我希望 API 会处理这个问题,而不是我!
    • @Richard 在 API 级别重试通常是个坏主意
    • @ShayErlichmen - 为什么?这些天发送电子邮件不应该是“发送并忘记”的任务吗?我偶尔会遇到The API call mail.Send() took too long to respond and was cancelled 错误,但无事可做?
    【解决方案2】:

    您必须通过make_sync_call 方法来创建更宽松的截止日期。

    Take a look at this answer

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2017-09-20
      • 2018-04-09
      • 1970-01-01
      • 2016-10-24
      • 2016-07-20
      • 2018-11-19
      • 1970-01-01
      相关资源
      最近更新 更多