From 6b3fa63501c471741128173660954d2cf0809374 Mon Sep 17 00:00:00 2001 From: admin Date: Mon, 20 Jul 2026 04:06:43 +0000 Subject: [PATCH] Fix: Use download_with_sanity_check() and fail container on download failure --- backend/app/main.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/backend/app/main.py b/backend/app/main.py index cbaaa91..ec96299 100644 --- a/backend/app/main.py +++ b/backend/app/main.py @@ -62,14 +62,14 @@ async def run_initial_download(): logger.info(f"MTGJSON data already exists (last refresh: {last_refresh})") return - logger.info("Running initial MTGJSON data download...") + logger.info("Running initial MTGJSON data download with sanity checks...") logger.info("This may take several minutes depending on network speed...") - # Download files - success = await manager.download_files() + # Download files with sanity checking and retry logic + success = await manager.download_with_sanity_check() if not success: - logger.error("Failed to download MTGJSON files") - return + logger.error("Failed to download MTGJSON files after retries - marking container unhealthy") + raise RuntimeError("MTGJSON data download failed after all retry attempts") # Unpack files await manager.unpack_files()