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

Function requests_retry_session

python3_cron_scripts/get_azure_data.py:62–82  ·  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

60
61
62def requests_retry_session(
63 retries=5,
64 backoff_factor=7,
65 status_forcelist=[408, 500, 502, 503, 504],
66 session=None,
67):
68 """
69 A Closure method for this static method.
70 """
71 session = session or requests.Session()
72 retry = Retry(
73 total=retries,
74 read=retries,
75 connect=retries,
76 backoff_factor=backoff_factor,
77 status_forcelist=status_forcelist,
78 )
79 adapter = HTTPAdapter(max_retries=retry)
80 session.mount("http://", adapter)
81 session.mount("https://", adapter)
82 return session
83
84
85def main(logger=None):

Callers 1

mainFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected