mirror of
https://github.com/Abdess/retroarch_system.git
synced 2026-12-02 06:18:51 -06:00
fix: let core.upstream refuse requests offline
RETROBIOS_OFFLINE was read by six callers and never by the network gateway: a caller that did not pass offline=True sent the request, untokened. core.offline holds the rule, open_retrying refuses with OfflineError and the cached reads answer as an offline run. The callers read the same predicate, and the tests that fake the network clear the variable for themselves (tests.ONLINE).
This commit is contained in:
1 parent
409cc843f9
commit
83e810d1b3
23 files changed
+124
-17
No files matched your search
@@ -5,6 +5,8 @@ from __future__ import annotations
|
||||
import functools
|
||||
import os
|
||||
|
||||
from core.offline import run_is_offline
|
||||
|
||||
|
||||
@functools.lru_cache(maxsize=1)
|
||||
def _gh_cli_token() -> str:
|
||||
@@ -41,7 +43,7 @@ def github_token() -> str:
|
||||
call and never ask gh.
|
||||
"""
|
||||
token = os.environ.get("GITHUB_TOKEN") or os.environ.get("GH_TOKEN") or ""
|
||||
if token or os.environ.get("RETROBIOS_OFFLINE"):
|
||||
if token or run_is_offline():
|
||||
return token
|
||||
token = _gh_cli_token()
|
||||
if token:
|
||||
|
||||
Reference in new issue
Block a user