mirror of
				https://github.com/TheAnachronism/docspell.git
				synced 2025-10-30 21:40:12 +00:00 
			
		
		
		
	Don't fail processing if generating preview fails
This commit is contained in:
		| @@ -32,7 +32,16 @@ object AttachmentPreview { | ||||
|           s"Creating preview images for ${item.attachments.size} files…" | ||||
|         ) | ||||
|         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 | ||||
|     } | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user