From 6673a77b8a3bcf90142d75d75a6248d4695b3f19 Mon Sep 17 00:00:00 2001 From: Mawoka Date: Tue, 13 Jun 2023 11:27:17 +0200 Subject: [PATCH] :ambulance: Fixed thumbhash worker error --- classquiz/worker/storage.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/classquiz/worker/storage.py b/classquiz/worker/storage.py index 2ada401..2328703 100644 --- a/classquiz/worker/storage.py +++ b/classquiz/worker/storage.py @@ -49,9 +49,11 @@ async def calculate_hash(ctx, file_id_as_str: str): async for chunk in file_bytes: async for c in chunk: file.write(c) - - if 0 < file_data.size < 20_970_000: # greater than 0 but smaller than 20mbytes - file_data.thumbhash = image_to_thumbhash(file) + try: + if 0 < file_data.size < 20_970_000: # greater than 0 but smaller than 20mbytes + file_data.thumbhash = image_to_thumbhash(file) + except Exception: + pass hash_obj = xxhash.xxh3_128() # assert hash_obj.block_size == 64