You've already forked DataMate
feat(api): 添加 graphrag 权限规则和优化知识图谱缓存失效
Some checks failed
Some checks failed
- 在权限规则匹配器中添加 /api/graphrag/** 的读写权限控制 - 修改图关系服务中的删除操作以精确失效相关实体缓存 - 更新图同步服务确保 BELONGS_TO 关系在增量同步时正确重建 - 重构图同步步骤服务中的组织归属关系构建逻辑 - 修复前端图_canvas 组件中的元素点击事件处理逻辑 - 实现 Python GraphRAG 缓存的启用/禁用功能 - 为 GraphRAG 缓存统计和清除接口添加调用方日志记录
This commit is contained in:
@@ -260,9 +260,10 @@ async def query_stream(
|
||||
summary="缓存统计",
|
||||
description="返回 GraphRAG 检索缓存的命中率和容量统计。",
|
||||
)
|
||||
async def cache_stats():
|
||||
async def cache_stats(caller: Annotated[str, Depends(_require_caller_id)]):
|
||||
from app.module.kg_graphrag.cache import get_cache
|
||||
|
||||
logger.info("GraphRAG cache stats requested by caller=%s", caller)
|
||||
return StandardResponse(code=200, message="success", data=get_cache().stats())
|
||||
|
||||
|
||||
@@ -272,8 +273,9 @@ async def cache_stats():
|
||||
summary="清空缓存",
|
||||
description="清空所有 GraphRAG 检索缓存。",
|
||||
)
|
||||
async def cache_clear():
|
||||
async def cache_clear(caller: Annotated[str, Depends(_require_caller_id)]):
|
||||
from app.module.kg_graphrag.cache import get_cache
|
||||
|
||||
logger.info("GraphRAG cache clear requested by caller=%s", caller)
|
||||
get_cache().clear()
|
||||
return StandardResponse(code=200, message="success", data={"cleared": True})
|
||||
|
||||
Reference in New Issue
Block a user