From 3fadff154294c2e7c89758215e4d6f031102bfd1 Mon Sep 17 00:00:00 2001 From: jochen Date: Fri, 27 Nov 2026 10:33:27 +0100 Subject: [PATCH] Wait 30 s for a Jolpica schedule, not 10 Jolpica answers a season it has not served lately in over 10 s (13.5 s for 2024 on 2026-11-27), so a cold fill timed out 18 seasons and the Kometa file and the library page went without them until asked again (found by the library page's test). Claude-Session: https://claude.ai/code/session_01NcbgfJAa38xFpzy69BWrqh --- ergast_service.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ergast_service.py b/ergast_service.py index d579f0e..8a1d861 100644 --- a/ergast_service.py +++ b/ergast_service.py @@ -35,6 +35,7 @@ class ErgastService: RETRIES = 3 # a throttled request (429) is asked again after a pause, at most this often OPEN_SEASON_TTL = 6 * 3600 # a season not yet over is asked again after six hours FAILED_BACKOFF = 600 # after a failed ask, a season is not asked again for ten minutes + REQUEST_TIMEOUT = 30 # Jolpica answers a season it has not served lately in over 10 s (13.5 s seen) # Country name normalization: Jolpica country → our country slug country_map = { @@ -111,7 +112,7 @@ class ErgastService: time.sleep(wait) self._last_request = time.monotonic() try: - with urllib.request.urlopen(url, timeout=10) as resp: + with urllib.request.urlopen(url, timeout=self.REQUEST_TIMEOUT) as resp: return json.loads(resp.read())['MRData']['RaceTable']['Races'] except urllib.error.HTTPError as e: if e.code != 429 or attempt == self.RETRIES: