Introduced --retries flag, made thorough refactoring

- updated sites list
- test scripts linting
This commit is contained in:
Soxoj
2021-05-01 23:51:48 +03:00
parent 7fd4a2c516
commit 5ee91f6659
18 changed files with 6182 additions and 4943 deletions
+13 -2
View File
@@ -57,6 +57,17 @@ ERRORS_TYPES = {
'Request timeout': 'Try to increase timeout or to switch to another internet service provider',
}
TEMPORARY_ERRORS_TYPES = [
'Request timeout',
'Unknown',
'Request failed',
'Connecting failure',
'HTTP',
'Proxy',
'Interrupted',
'Connection lost',
]
THRESHOLD = 3 # percent
@@ -64,8 +75,8 @@ def is_important(err_data):
return err_data['perc'] >= THRESHOLD
def is_not_permanent(err_data):
return True
def is_permanent(err_type):
return err_type not in TEMPORARY_ERRORS_TYPES
def detect(text):