ovh / python-ovh

Thin wrapper around OVH's APIs. Handles all the hard work including credential creation and requests signing.
https://pypi.org/project/ovh/
Other
278 stars 76 forks source link

feat(backoff): implement backoff when ApiError is called ? #69

Closed martintamare closed 1 year ago

martintamare commented 5 years ago

I think auto retry would be a nice feature.

What do you think about the following approach ?

It use backoff and by default has the same behavior as the old client. If someone would use auto_retry=4 in client init, if call would rise an APIError, it wall autoretry.

Tests are not done yet but will be, if you want it interesting.

rbeuque74 commented 1 year ago

Hello, Thanks for your proposal. The current implementation would imply that all APIError, such as 400 Bad Request would be retried, which is not something we want.

A new implementation of the retry that would retry network error, or internal server error could be accepted.

Thanks Romain

martintamare commented 1 year ago

I added exceptions as a parameter and created another PR.