Mofivy url_reachabliity to remove URLs if status 404

This commit is contained in:
Marian Steinbach 2018-10-02 22:45:18 +02:00
parent cf9136b481
commit 2cebb3ff28

View file

@ -60,6 +60,10 @@ class Checker(AbstractChecker):
# remove source URL, add target URL to config.urls
self.config.remove_url(url)
self.config.add_url(r.url)
# remove 404 etc
if r.status_code > 400:
self.config.remove_url(url)
except Exception as exc:
logging.info("Exception for URL %s: %s %s", url, str(type(exc)), exc)