Deadline exceeded while posting multiple cards to timelines with a video attached

后端 未结 2 1682
攒了一身酷
攒了一身酷 2021-02-11 06:16

first of all i\'m using python over gae and i\'m trying to push a card with a video attachment to all the users that visited my glassware. This is the code:

             


        
2条回答
  •  感情败类
    2021-02-11 07:03

    I too was experiencing this type of issue. In order to solve it, I had to increase the timeout for HTTP requests as well as move to a Queue.

    I submitted a pull request to the Google Mirror API Python example, but it got rejected to keep things "simple".

    You can checkout my diff at https://github.com/JessieAMorris/mirror-quickstart-python/commit/b67c0ecdf83207b0c3b596173c95a53804b23525.

    Basically, the synopsis is:

    1. Move processing to a queue
    2. import urlfetch and httplib2
    3. Increase the timeouts for urlfetch and httplib2 like so:

      urlfetch.set_default_fetch_deadline(45)
      httplib2.Http(timeout=45) 
      

    With those changes in place, I don't get timeouts any more.

提交回复
热议问题