diff --git a/backend/handler/metadata/hltb_handler.py b/backend/handler/metadata/hltb_handler.py index 332f5fee5..6ad3a164e 100644 --- a/backend/handler/metadata/hltb_handler.py +++ b/backend/handler/metadata/hltb_handler.py @@ -42,7 +42,6 @@ HLTB_MAX_REQUESTS_PER_SECOND: Final[float] = 3 # One attempt, plus one for a renewed session and one for a rate-limit backoff. HLTB_MAX_REQUEST_ATTEMPTS: Final[int] = 3 HLTB_RATE_LIMIT_BACKOFF_SECONDS: Final[float] = 2 -# How long a failed session mint is left alone before another lookup retries it. HLTB_SESSION_RETRY_SECONDS: Final[float] = 60 _rate_limiter = RateLimiter(HLTB_MAX_REQUESTS_PER_SECOND) @@ -330,8 +329,8 @@ class HLTBHandler(MetadataHandler): if self._has_session(): return True - # A mint that just failed means HLTB is down or blocking this host, so - # every remaining ROM in a scan should not pay for its own round trip. + # A mint that just failed means HLTB is down or blocking this host, + # so every ROM left in a scan must not pay for its own round trip. now = time.monotonic() if now < self._session_retry_after: return False diff --git a/backend/utils/hltb_search.py b/backend/utils/hltb_search.py index c4f3d64a3..22c1b9384 100644 --- a/backend/utils/hltb_search.py +++ b/backend/utils/hltb_search.py @@ -1,5 +1,5 @@ """The HowLongToBeat search wire contract, shared by the handler and the endpoint -discovery script so the script validates a route against what the handler sends.""" +discovery script.""" from typing import Final, NamedTuple diff --git a/backend/utils/update_hltb_api_url.py b/backend/utils/update_hltb_api_url.py index 9122d0617..b800860ba 100644 --- a/backend/utils/update_hltb_api_url.py +++ b/backend/utils/update_hltb_api_url.py @@ -22,8 +22,7 @@ from utils.hltb_search import ( search_headers, ) -# Next.js lists every route it serves as a plain literal in _buildManifest.js, so -# discovery does not depend on how the app bundle is built or minified. +# Next.js lists every route it serves as a plain literal in _buildManifest.js. BUILD_MANIFEST_REGEX = re.compile( r'src=["\'](?P[^"\']*/_next/static/[^"\']+/_buildManifest\.js)["\']' ) @@ -102,8 +101,7 @@ def _rejection_reason( except (httpx.RequestError, httpx.HTTPStatusError, ValueError) as e: return str(e) - # The same shape search_games() reads, so a wrong route cannot pass by - # returning some other 200. + # The same shape search_games() reads. if not isinstance(results, list) or not results: return "search returned no results"