From f2159da24bf81b8004f54fab13e6494c3d65e942 Mon Sep 17 00:00:00 2001 From: Nachtalb Date: Mon, 24 Jul 2023 22:44:06 +0200 Subject: [PATCH] Throw warning if we can't send all additional files for some resaon --- reverse_image_search/app.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/reverse_image_search/app.py b/reverse_image_search/app.py index c1a62cc..6dcd2f3 100644 --- a/reverse_image_search/app.py +++ b/reverse_image_search/app.py @@ -177,6 +177,12 @@ async def send_message_construct( if additional_files_tasks: ready_files = [(file, type_) for file, type_ in await gather(*additional_files_tasks) if file is not None] + if len(additional_files_tasks) != len(ready_files): + self.logger.warning( + f"Can't send all additional files, wanted: {len(additional_files_tasks)}, ready:" + f" {len(ready_files)}. The result comes from {result.provider.name}" + ) + await self._send_media_group( files=ready_files, message=main_message,