mirror of
https://github.com/TheAnachronism/docspell.git
synced 2025-03-29 02:05:07 +00:00
Don't fail processing if generating preview fails
This commit is contained in:
parent
cf6e63785d
commit
6037b54959
@ -32,7 +32,16 @@ object AttachmentPreview {
|
|||||||
s"Creating preview images for ${item.attachments.size} files…"
|
s"Creating preview images for ${item.attachments.size} files…"
|
||||||
)
|
)
|
||||||
preview <- PdfboxPreview(24)
|
preview <- PdfboxPreview(24)
|
||||||
_ <- item.attachments.traverse(createPreview(ctx, preview, cfg.chunkSize))
|
_ <- item.attachments
|
||||||
|
.traverse(createPreview(ctx, preview, cfg.chunkSize))
|
||||||
|
.attempt
|
||||||
|
.flatMap {
|
||||||
|
case Right(_) => ().pure[F]
|
||||||
|
case Left(ex) =>
|
||||||
|
ctx.logger.error(ex)(
|
||||||
|
s"Creating preview images failed, continuing without it."
|
||||||
|
)
|
||||||
|
}
|
||||||
} yield item
|
} yield item
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user