mirror of
https://github.com/deadc0de6/dotdrop.git
synced 2026-02-08 22:29:18 +00:00
check links retries
This commit is contained in:
@@ -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)
|
||||||
|
|||||||
Reference in New Issue
Block a user