Tweak/fix the attachment caching
This commit is contained in:
parent
d544cf893e
commit
619044d285
3 changed files with 10 additions and 3 deletions
5
tasks.py
5
tasks.py
|
@ -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}")
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue