This commit is contained in:
2023-05-20 21:36:38 +02:00
parent a202e70981
commit db1104aead

View File

@@ -125,13 +125,10 @@ async def cache_file_by_book_id(
f"{book_id}_{file_type}", blocking_timeout=5, thread_local=False f"{book_id}_{file_type}", blocking_timeout=5, thread_local=False
) )
try: if await lock.locked() and not by_request:
async with lock: raise Retry
result = await cache_file(book, file_type)
except Exception as e: result = await cache_file(book, file_type)
if by_request:
return None
raise Retry from e
if by_request: if by_request:
return result return result