Skip to content

requests' session is created every time #162

@yabirgb

Description

@yabirgb

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions