Skip to content

Commit

Permalink
Use a fresh connection on every request
Browse files Browse the repository at this point in the history
  • Loading branch information
grego118 committed Sep 4, 2024
1 parent 7bba2ba commit 83a6059
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions nylas/handler/http_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ def __init__(self, api_server, api_key, timeout):
self.api_server = api_server
self.api_key = api_key
self.timeout = timeout
self.session = requests.Session()

def _execute(
self,
Expand All @@ -90,7 +89,7 @@ def _execute(
if overrides and overrides.get("timeout"):
timeout = overrides["timeout"]
try:
response = self.session.request(
response = requests.request(
request["method"],
request["url"],
headers=request["headers"],
Expand All @@ -117,7 +116,7 @@ def _execute_download_request(
if overrides and overrides.get("timeout"):
timeout = overrides["timeout"]
try:
response = self.session.request(
response = requests.request(
request["method"],
request["url"],
headers=request["headers"],
Expand Down

0 comments on commit 83a6059

Please sign in to comment.