1
0
mirror of https://github.com/deadc0de6/dotdrop.git synced 2026-02-08 18:59:16 +00:00

check links retries

This commit is contained in:
deadc0de6
2023-04-13 22:54:25 +02:00
committed by deadc0de
parent cb1871f580
commit f8ca816d2a

View File

@@ -21,6 +21,9 @@ BLUE = '\033[94m'
MAGENTA = '\033[95m' MAGENTA = '\033[95m'
RESET = '\033[0m' RESET = '\033[0m'
RETRY_TOTAL = 10
RETRY_CONNECT = 5
TIMEOUT = 10 TIMEOUT = 10
VALID_RET = [ VALID_RET = [
200, 200,
@@ -57,7 +60,9 @@ def get_session():
"""get a session with retry""" """get a session with retry"""
session = requests.Session() session = requests.Session()
retry_on = [404, 429, 500, 502, 503, 504] 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, backoff_factor=1,
allowed_methods=False, allowed_methods=False,
status_forcelist=retry_on) status_forcelist=retry_on)