MCPcopy Create free account
hub / github.com/adobe/Marinus / _requests_retry_session

Function _requests_retry_session

python3_cron_scripts/upload_akamai_data.py:34–54  ·  view source on GitHub ↗

A Closure method for this static method.

(
    retries=5,
    backoff_factor=7,
    status_forcelist=[408, 500, 502, 503, 504],
    session=None,
)

Source from the content-addressed store, hash-verified

32
33
34def _requests_retry_session(
35 retries=5,
36 backoff_factor=7,
37 status_forcelist=[408, 500, 502, 503, 504],
38 session=None,
39):
40 """
41 A Closure method for this static method.
42 """
43 session = session or requests.Session()
44 retry = Retry(
45 total=retries,
46 read=retries,
47 connect=retries,
48 backoff_factor=backoff_factor,
49 status_forcelist=status_forcelist,
50 )
51 adapter = HTTPAdapter(max_retries=retry)
52 session.mount("http://", adapter)
53 session.mount("https://", adapter)
54 return session
55
56
57def main(logger=None):

Callers 1

mainFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected