Instead of reusing a requests' session the code creates a new one each time
|
with requests.Session() as session: |
this means that DNS resolution is performed for every request for example in addition to other steps that take place during the connection.
We have noticed this because every now and then we see resolution errors when calling the Braintree API using the sdk.
Task
- Use correctly request's session in the code
Instead of reusing a requests' session the code creates a new one each time
braintree_python/braintree/util/http.py
Line 116 in 7d9bf8a
this means that DNS resolution is performed for every request for example in addition to other steps that take place during the connection.
We have noticed this because every now and then we see resolution errors when calling the Braintree API using the sdk.
Task