MCPcopy Create free account
hub / github.com/su-kaka/gcli2api / reload_config

Function reload_config

config.py:73–89  ·  view source on GitHub ↗

重新加载配置(修改配置后调用)

()

Source from the content-addressed store, hash-verified

71
72
73async def reload_config():
74 """重新加载配置(修改配置后调用)"""
75 global _config_cache, _config_initialized
76
77 try:
78 from src.storage_adapter import get_storage_adapter
79 storage_adapter = await get_storage_adapter()
80
81 # 如果后端支持 reload_config_cache,调用它
82 if hasattr(storage_adapter._backend, 'reload_config_cache'):
83 await storage_adapter._backend.reload_config_cache()
84
85 # 重新加载配置缓存
86 _config_cache = await storage_adapter.get_all_config()
87 _config_initialized = True
88 except Exception:
89 pass
90
91
92def _get_cached_config(key: str, default: Any = None) -> Any:

Callers

nothing calls this directly

Calls 3

get_storage_adapterFunction · 0.90
reload_config_cacheMethod · 0.45
get_all_configMethod · 0.45

Tested by

no test coverage detected