MCPcopy Create free account
hub / github.com/ElementsProject/lightning / http_session_with_retry

Function http_session_with_retry

tests/test_clnrest.py:21–30  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

19
20
21def http_session_with_retry():
22 # All requests are done after matching "REST server running" in the log,
23 # but there may be a 'small' lag between that message in the log and the
24 # web server really available for incoming requests. So we use an http
25 # session to retry several times the requests.
26 http_session = requests.Session()
27 retry = Retry(connect=10, backoff_factor=0.5)
28 adapter = HTTPAdapter(max_retries=retry)
29 http_session.mount('https://', adapter)
30 return http_session
31
32
33def test_no_auto_start(node_factory):

Calls

no outgoing calls

Tested by

no test coverage detected