Skip to content

Commit b9ea597

Browse files
committed
improve documentation and reduce backoff_factor to 3
1 parent 62ab4e1 commit b9ea597

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

scripts/shared.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@ def __init__(self, message, exit_code=None):
3737

3838
def get_session(accept_header=None, session=None):
3939
"""
40-
Create or configure a reusable HTTPS session with retry logic and headers.
40+
Create or configure a reusable HTTPS session with retry logic and
41+
appropriate headers.
4142
"""
4243
if session is None:
4344
session = Session()
@@ -46,9 +47,11 @@ def get_session(accept_header=None, session=None):
4647
# (With only a https:// adapter, below, unencrypted requests will fail.)
4748
session.adapters = OrderedDict()
4849

50+
# Try again after 0s, 6s, 12s, 24s, 48s (total 90s) for the specified HTTP
51+
# error codes (STATUS_FORCELIST)
4952
retry_strategy = Retry(
5053
total=5,
51-
backoff_factor=10,
54+
backoff_factor=3,
5255
status_forcelist=STATUS_FORCELIST,
5356
allowed_methods=["GET", "POST"],
5457
raise_on_status=False,

0 commit comments

Comments
 (0)