Open
Description
We have occasionally connection errors with our internal proxy, and could benefit to set the automatic retry of requests
's Session
(https://requests.readthedocs.io/en/latest/user/advanced/#example-automatic-retries).
Would you be open to add the automatic retry on the request's Session?
# cert_manager/client.py
from urllib3.util import Retry
from requests import Session
from requests.adapters import HTTPAdapter
...
class Client:
def __init__(self, **kwargs):
...
self.__session = requests.Session()
retries = Retry(
total=3,
backoff_factor=0.1,
allowed_methods={"HEAD", "GET", "POST", "PUT", "PATCH", "DELETE"},
)
self.__session.mount('https://', HTTPAdapter(max_retries=retries))
Or eventually to allowing to pass a Session
object during the Client
creation?
Metadata
Metadata
Assignees
Labels
No labels