mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-07-12 13:52:15 +00:00
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:
commit
b3c7b34885
1 changed files with 3 additions and 2 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue