mirror of
https://github.com/flibusta-apps/telegram_files_cache_server.git
synced 2025-12-06 14:45:36 +01:00
Fix timeouts
This commit is contained in:
@@ -65,10 +65,15 @@ async def cache_file(book: Book, file_type: str) -> Optional[CachedFile]:
|
|||||||
).exists():
|
).exists():
|
||||||
return
|
return
|
||||||
|
|
||||||
|
retry_exc = Retry(defer=60)
|
||||||
|
|
||||||
|
try:
|
||||||
data = await download(book.source.id, book.remote_id, file_type)
|
data = await download(book.source.id, book.remote_id, file_type)
|
||||||
|
except httpx.TimeoutException:
|
||||||
|
raise retry_exc
|
||||||
|
|
||||||
if data is None:
|
if data is None:
|
||||||
raise Retry(defer=60)
|
raise retry_exc
|
||||||
|
|
||||||
response, client, filename = data
|
response, client, filename = data
|
||||||
caption = get_caption(book)
|
caption = get_caption(book)
|
||||||
|
|||||||
Reference in New Issue
Block a user