Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion linkcheck/listeners.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,10 @@ def do_check_instance_links(sender, instance, wait=False):

if len(url) > MAX_URL_LENGTH:
# We cannot handle url longer than MAX_URL_LENGTH at the moment
logger.warning('URL exceeding max length will be skipped: %s', url)
if url.startswith("data:"):
# If the URL is a data URL, it might occupy a LOT of space in the logs without being useful – truncate it
url = url[:64]
logger.warning('URL exceeding max length will be skipped: %s (in %r)', url, instance)
continue

u, created = Url.objects.get_or_create(url=url)
Expand Down
5 changes: 4 additions & 1 deletion linkcheck/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,10 @@ def update_urls(urls, content_type, object_id):

if len(url) > MAX_URL_LENGTH:
# We cannot handle url longer than MAX_URL_LENGTH at the moment
logger.warning("URL exceeding max length will be skipped: %s", url)
if url.startswith("data:"):
# If the URL is a data URL, it might occupy a LOT of space in the logs without being useful – truncate it
url = url[:64]
logger.warning("URL exceeding max length will be skipped: %s (in %r)", url, instance)
continue

url, url_created = Url.objects.get_or_create(url=url)
Expand Down