fix: search_documents 端点添加异常处理防止 traceback 泄露

This commit is contained in:
2026-07-10 15:18:46 +08:00
parent 284a4b9e09
commit 0a4a4c766c
3 changed files with 14 additions and 21 deletions
-12
View File
@@ -63,18 +63,6 @@ for label, d in targets:
skipped.append((f.name, size))
continue
files.append((label, str(f)))
# 顶层 .md 文件
for target_info in targets:
d = target_info[1]
p = Path(d)
if not p.exists():
continue
for f in p.glob("*.md"):
sz = f.stat().st_size
if sz > MAX_SIZE:
skipped.append((f.name, sz))
else:
files.append(("顶层/" + p.name, str(f)))
log(f"待处理: {len(files)} 个文件")
if skipped: