Nantes Université

Skip to content
Extraits de code Groupes Projets
Valider 2a64a7cc rédigé par Victor CONNES's avatar Victor CONNES
Parcourir les fichiers

fix on deadlink due to execisvely long readtime

parent abeb194e
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
......@@ -5,7 +5,9 @@ from catalog.models import Resource
def _is_dead_link(url):
try:
r = requests.head(url, timeout=5)
r = requests.head(url, timeout=50)
except requests.exceptions.ReadTimeout:
return True, "ReadTimeout"
except requests.exceptions.ConnectTimeout:
return True, "ConnectTimeout"
except requests.exceptions.ConnectionError:
......@@ -42,5 +44,7 @@ def update_dead_entry_points():
print(f"\t{n_new_dead_entry_points}/{n_dead_entry_points}({n_new_dead_entry_points/n_dead_entry_points*100:.2f}%) new deadlinks")
for r, v in reasons.items():
print(f"\t\t * {r}: {len(v)}/{total}({len(v)/total*100:.2f}%)")
print("\n List of Missing Schema : \n", "\t-", "\n \t-".join(map(lambda x: x.entry_point, reasons["MissingSchema"])))
print("\n List of Invalid Schema : \n", "\t-", "\n \t-".join(map(lambda x: x.entry_point, reasons["InvalidSchema"])))
if "MissingSchema" in reasons:
print("\n List of Missing Schema : \n", "\t-", "\n \t-".join(map(lambda x: x.entry_point, reasons["MissingSchema"])))
if "InvalidSchema" in reasons:
print("\n List of Invalid Schema : \n", "\t-", "\n \t-".join(map(lambda x: x.entry_point, reasons["InvalidSchema"])))
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter