http_retry_request_with_sleep_middleware
Documentation for eth_defi.middleware.http_retry_request_with_sleep_middleware function.
- http_retry_request_with_sleep_middleware(make_request, web3)
A HTTP retry middleware with sleep and backoff.
MIGRATED: In web3.py v7+, this function is deprecated in favor of ExceptionRetryConfiguration on the provider. However, for backwards compatibility, this function still works but may not be called if v7 provider retry configuration is used instead.
If you want to customise timeouts, supported exceptions and such you can directly create your own middleware using
exception_retry_middleware().Usage:
web3.middleware_onion.clear() web3.middleware_onion.inject(http_retry_request_with_sleep_middleware, layer=0)