Skip to content

Commit

Permalink
ttl
Browse files Browse the repository at this point in the history
  • Loading branch information
mamico committed May 7, 2024
1 parent a197e7d commit 6340be2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/redturtle/volto/linkchecker.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,13 +224,13 @@ def _check_internal_link(self, link):
return 404

@view.memoize
def _check_external_link(self, link, ttl=3600 * 6, timeout=5.0):
def _check_external_link(self, link, ttl=3600 * 6, timeout=1.0):
"""Check the external link"""
logger.info("Checking external link %s", link)
logger.warning("Checking external link %s", link)

if link in self._external_links_status:
last_update, status = self._external_links_status[link]
if (datetime.now() - last_update).total_seconds() < ttl:
if status == 200 and (datetime.now() - last_update).total_seconds() < ttl:
return status
try:
headers = {"User-Agent": self.user_agent}
Expand Down

0 comments on commit 6340be2

Please sign in to comment.