From f8ca816d2a51bbb4d3ee5bd37387914fa269a98e Mon Sep 17 00:00:00 2001 From: deadc0de6 Date: Thu, 13 Apr 2023 22:54:25 +0200 Subject: [PATCH] check links retries --- scripts/check_links.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/scripts/check_links.py b/scripts/check_links.py index 749c0c0..d7a91f2 100755 --- a/scripts/check_links.py +++ b/scripts/check_links.py @@ -21,6 +21,9 @@ BLUE = '\033[94m' MAGENTA = '\033[95m' RESET = '\033[0m' +RETRY_TOTAL = 10 +RETRY_CONNECT = 5 + TIMEOUT = 10 VALID_RET = [ 200, @@ -57,7 +60,9 @@ def get_session(): """get a session with retry""" session = requests.Session() retry_on = [404, 429, 500, 502, 503, 504] - retry = Retry(total=3, + retry = Retry(total=RETRY_TOTAL, + connect=RETRY_CONNECT, + status=RETRY_CONNECT, backoff_factor=1, allowed_methods=False, status_forcelist=retry_on)