Tweak/fix the attachment caching

This commit is contained in:
Thomas Sileo
2018-07-24 23:58:13 +02:00
parent d544cf893e
commit 619044d285
3 changed files with 10 additions and 3 deletions

View File

@@ -239,7 +239,10 @@ def cache_attachments(self, iri: str) -> None:
attachment.get("mediaType", "").startswith("image/")
or attachment.get("type") == ap.ActivityType.IMAGE.value
):
MEDIA_CACHE.cache(attachment["url"], Kind.ATTACHMENT)
try:
MEDIA_CACHE.cache(attachment["url"], Kind.ATTACHMENT)
except ValueError:
log.exception(f"failed to cache {attachment}")
log.info(f"attachments cached for {iri}")