Skip to content

Commit

Permalink
fix(session): Implement retry mechanism for closed connections
Browse files Browse the repository at this point in the history
  • Loading branch information
Vitor-Avila committed Aug 21, 2023
1 parent 1276894 commit 3335abf
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/preset_cli/auth/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
from typing import Any, Dict

from requests import Response, Session
from urllib3.util import Retry
from requests.adapters import HTTPAdapter
from urllib3.util import Retry


class Auth: # pylint: disable=too-few-public-methods
Expand All @@ -20,8 +20,8 @@ def __init__(self):

retries = Retry(
total=3, # max retries count
backoff_factor=0.2, # delay factor between attempts
# respect_retry_after_header=True,
backoff_factor=1, # delay factor between attempts
respect_retry_after_header=True,
)

self.session.mount("https://", HTTPAdapter(max_retries=retries))
Expand Down

0 comments on commit 3335abf

Please sign in to comment.