Fix: VDH-Scraper ReadTimeout — 60s read-Timeout, besseres Exception-Logging

This commit is contained in:
rene 2026-05-08 13:46:31 +02:00
parent da036d2b93
commit 00b7a54a8f

View file

@ -185,7 +185,8 @@ async def fetch_vdh_events() -> list[dict]:
raw_events: list[dict] = []
async with httpx.AsyncClient(timeout=20, follow_redirects=True) as client:
timeout = httpx.Timeout(connect=15.0, read=60.0, write=10.0, pool=10.0)
async with httpx.AsyncClient(timeout=timeout, follow_redirects=True) as client:
for url, parse_fn in sources:
try:
resp = await client.get(url, headers=headers)
@ -198,8 +199,10 @@ async def fetch_vdh_events() -> list[dict]:
logger.info(f"VDH-Scraper: Keine Events auf {url}")
except httpx.HTTPStatusError as e:
logger.warning(f"VDH-Scraper HTTP-Fehler {e.response.status_code} für {url}: {e}")
except httpx.TimeoutException as e:
logger.warning(f"VDH-Scraper Timeout für {url}: {type(e).__name__}")
except Exception as e:
logger.warning(f"VDH-Scraper Fehler für {url}: {e}")
logger.warning(f"VDH-Scraper Fehler für {url}: {type(e).__name__}: {e}")
if not raw_events:
logger.warning("VDH-Scraper: Keine Daten — verwende Fallback-Events.")