From ada96deeacb89c2772c17ed7b8932771359297f3 Mon Sep 17 00:00:00 2001 From: narugo1992 Date: Sat, 10 Aug 2024 00:30:02 +0800 Subject: [PATCH] dev(narugo): dont retry one 413 error code --- hfutils/utils/session.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hfutils/utils/session.py b/hfutils/utils/session.py index f6675eec66..34eca6d1d1 100644 --- a/hfutils/utils/session.py +++ b/hfutils/utils/session.py @@ -74,7 +74,7 @@ def get_requests_session(max_retries: int = 5, timeout: int = DEFAULT_TIMEOUT, v session = session or requests.session() retries = Retry( total=max_retries, backoff_factor=1, - status_forcelist=[408, 413, 429, 500, 501, 502, 503, 504, 505, 506, 507, 509, 510, 511], + status_forcelist=[408, 429, 500, 501, 502, 503, 504, 505, 506, 507, 509, 510, 511], allowed_methods=["HEAD", "GET", "POST", "PUT", "DELETE", "OPTIONS", "TRACE"], ) adapter = TimeoutHTTPAdapter(max_retries=retries, timeout=timeout, pool_connections=32, pool_maxsize=32)