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
296 stars 81 forks source link

Feat autoretry #116

Open martintamare opened 1 year ago

martintamare commented 1 year ago

Following https://github.com/ovh/python-ovh/pull/69

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, by default Exceptions HTTPError and NetworkError would perform an auto_retry. Exceptions can be parametrize so as to perform auto_retry on precise exceptions you want.

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