fix(model): 修复刷新模型缓存接口 NameError: model_cache is not defined
refresh_model_cache 函数中引用了 model_cache 但未导入, 该导入仅在 _refresh_model_cache 内部作用域中,外部无法访问。 添加局部 import 解决此问题。
This commit is contained in:
parent
775ac129dc
commit
e3307b4592
@ -193,6 +193,8 @@ async def refresh_model_cache(
|
|||||||
):
|
):
|
||||||
"""强制刷新模型缓存,从数据库重新加载所有供应商配置到 Redis。"""
|
"""强制刷新模型缓存,从数据库重新加载所有供应商配置到 Redis。"""
|
||||||
await _refresh_model_cache()
|
await _refresh_model_cache()
|
||||||
|
from yuxi.services.model_cache import model_cache
|
||||||
|
|
||||||
return {"success": True, "message": "缓存已刷新", "model_count": len(model_cache.get_all_specs())}
|
return {"success": True, "message": "缓存已刷新", "model_count": len(model_cache.get_all_specs())}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user