MCPcopy
hub / github.com/su-kaka/gcli2api / init_config

Function init_config

config.py:55–70  ·  view source on GitHub ↗

初始化配置缓存(启动时调用一次)

()

Source from the content-addressed store, hash-verified

53# ====================== 配置系统 ======================
54
55async def init_config():
56 """初始化配置缓存(启动时调用一次)"""
57 global _config_cache, _config_initialized
58
59 if _config_initialized:
60 return
61
62 try:
63 from src.storage_adapter import get_storage_adapter
64 storage_adapter = await get_storage_adapter()
65 _config_cache = await storage_adapter.get_all_config()
66 _config_initialized = True
67 except Exception:
68 # 初始化失败时使用空缓存
69 _config_cache = {}
70 _config_initialized = True
71
72
73async def reload_config():

Callers 1

get_config_valueFunction · 0.85

Calls 2

get_storage_adapterFunction · 0.90
get_all_configMethod · 0.45

Tested by

no test coverage detected