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

后端 未结 2 1686
攒了一身酷
攒了一身酷 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 06:59

    You have 60 seconds to complete a front-end request on Google App Engine. Locally however, that restriction doesn't seem to stick.

    Your only options for longer processing are task queues (10 minute deadline) and backends (indefinite).

    0 讨论(0)
  • 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.

    0 讨论(0)
提交回复
热议问题