MCPcopy Index your code
hub / github.com/dataease/SQLBot / is_cache_initialized

Function is_cache_initialized

backend/common/core/sqlbot_cache.py:145–160  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

143
144
145def is_cache_initialized() -> bool:
146 # 检查必要的属性是否存在
147 if not hasattr(FastAPICache, "_backend") or not hasattr(FastAPICache, "_prefix"):
148 return False
149
150 # 检查属性值是否为 None
151 if FastAPICache._backend is None or FastAPICache._prefix is None:
152 return False
153
154 # 尝试获取后端确认
155 try:
156 backend = FastAPICache.get_backend()
157 return backend is not None
158 except (AssertionError, AttributeError, Exception) as e:
159 SQLBotLogUtil.debug(f"缓存初始化检查失败: {str(e)}")
160 return False

Callers 1

wrapperFunction · 0.85

Calls 1

debugMethod · 0.45

Tested by

no test coverage detected