Skip to content

Commit

Permalink
Throw warning if we can't send all additional files for some resaon
Browse files Browse the repository at this point in the history
  • Loading branch information
Nachtalb committed Jul 24, 2023
1 parent 32b9aad commit f2159da
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions reverse_image_search/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit f2159da

Please sign in to comment.