How to set timeout for urlfetch in Google App Engine?

前端 未结 4 1497
灰色年华
灰色年华 2020-12-10 11:56

I\'m trying to have Django (on top of GAE) fetch data from another web service. I\'m often hit with error like this:

ApplicationError: 2 timed out Req

4条回答
  •  醉话见心
    2020-12-10 12:08

    It seems short but you have to know that the timeout of a request on GAE is around 30 seconds. As you probably need to do some operations on the response of your urlfetch, there's no need to have a timeout more than 10 seconds I think.

提交回复
热议问题