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
This commit is contained in:
+2
-1
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user