Merge pull request #58526 from NousResearch/salvage/3923-website-policy-cache-key

fix(website-policy): key blocklist cache on real default config path (salvage #3923)
This commit is contained in:
Teknium 2026-07-05 00:45:46 -07:00 committed by GitHub
commit b3c7b34885
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -137,7 +137,8 @@ def load_website_blocklist(config_path: Optional[Path] = None) -> Dict[str, Any]
"""
global _cached_policy, _cached_policy_path, _cached_policy_time
resolved_path = str(config_path) if config_path else "__default__"
default_path = str(_get_default_config_path())
resolved_path = str(config_path) if config_path else default_path
now = time.monotonic()
# Return cached policy if still fresh and same path
@ -193,7 +194,7 @@ def load_website_blocklist(config_path: Optional[Path] = None) -> Dict[str, Any]
if config_path == _get_default_config_path():
with _cache_lock:
_cached_policy = result
_cached_policy_path = "__default__"
_cached_policy_path = resolved_path
_cached_policy_time = now
return result