google-api-python-client HttpRequest execute() exponential backoff

  • Posted on: 22 December 2016
  • By: oon
google-api-python-client

Google API python client already implement automatic retry with exponential backoff [1],

if you sometime hit API error because of rate limit or the API server overload because of too many connections.

add num_retries parameter on execute()

num_retries: Integer, number of times to retry 500's with randomized
        exponential backoff. If all retries fail, the raised HttpError
        represents the last request. If zero (default), we attempt the
        request only once.

[1]https://google.github.io/google-api-python-client/docs/epy/googleapiclie...
[2]https://github.com/google/google-api-python-client/pull/160

 

Tags: 

Add new comment

Filtered HTML

  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <blockquote> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
By submitting this form, you accept the Mollom privacy policy.