@@ -18,7 +18,6 @@ define your ``MyCustomHTTPClient`` class as follows:
18
18
19
19
from __future__ import absolute_import, unicode_literals
20
20
21
- from requests.packages.urllib3.util import Retry
22
21
from requests.adapters import HTTPAdapter
23
22
from requests import Session, exceptions
24
23
@@ -28,11 +27,9 @@ define your ``MyCustomHTTPClient`` class as follows:
28
27
29
28
class MyCustomHTTPClient (BaseHTTPClient ):
30
29
31
- def __init__ (self , max_retries = 5 ):
30
+ def __init__ (self , retries = 5 ):
32
31
self ._session = Session()
33
- self ._session.mount(' https://' , HTTPAdapter(
34
- max_retries = Retry(total = max_retries, status_forcelist = [500 ])
35
- ))
32
+ self ._session.mount(' https://' , HTTPAdapter(max_retries = retries))
36
33
self ._check_cert = False
37
34
38
35
def head (self , url , params = None , headers = None , auth = None ):
@@ -153,7 +150,7 @@ Then you would inject your HTTP client as shown below:
153
150
client = ArangoClient(
154
151
username = ' root' ,
155
152
password = ' ' ,
156
- http_client = MyCustomHTTPClient(max_retries = 10 ),
153
+ http_client = MyCustomHTTPClient(retries = 10 ),
157
154
use_session = True , # This flag (used in the default client) is now ignored
158
155
check_cert = True # This flag (used in the default client) is now ignored
159
156
)
0 commit comments