fix: restore main runtime sources and cache consistency
This commit is contained in:
@@ -664,6 +664,17 @@ class KnowledgeSyncService:
|
||||
except Exception as e:
|
||||
logger.warning(f"递增缓存版本号失败: {e}")
|
||||
|
||||
# 语义缓存没有知识库版本字段,文档增删改后必须清空;否则回答缓存
|
||||
# 可能继续返回已过时的来源、引用或图片路径。
|
||||
try:
|
||||
from core.semantic_cache import get_semantic_cache
|
||||
semantic_cache = get_semantic_cache()
|
||||
if semantic_cache:
|
||||
semantic_cache.clear()
|
||||
logger.debug(f"已清空语义缓存(文档变更触发): {kb_name}")
|
||||
except Exception as e:
|
||||
logger.warning(f"清空语义缓存失败: {e}")
|
||||
|
||||
return True
|
||||
|
||||
except Exception as e:
|
||||
|
||||
Reference in New Issue
Block a user