Repository navigation
fix(backend): 推荐缓存即时失效 + 相似/查重/引用补强排除 rejected + cluster_map 异步缓存 - #37
Merged
Merged
Conversation
PR1 — 后端一致性/性能/缓存基线 - recommendation_service: 新增 invalidate_recommendations(),按前缀清 recommend:* 与 today_summary 缓存 - papers.toggle_reject: 调用 invalidate_recommendations(),负反馈立即生效 (此前被拒论文最长 5min 仍留在推荐列表) - papers.similar / duplicates: get_by_id 抛 ValueError 统一转 404(此前 500) - repositories.similar_by_embedding / semantic_candidates: PG+SQLite 分支 均加 Paper.rejected.is_(False),与推荐策略对齐 - graph.cluster_map / similarity_map: 改 async + run_in_threadpool + 60s 缓存, 避免全库 k-means/UMAP 阻塞 ASGI 事件循环 - graph.similar_via_citation: paper_id 改 UUID 校验;论文不存在转 404 - similarity.similar_via_citation: co-citation 扩张加 LIMIT(200/2000/500) 防高被引 hub 无界扩张 OOM;候选加 rejected 过滤;去掉 if not seed 死代码 (get_by_id 已 raise)
🔍 OpenCode PR Review Required这是一个受保护的分支,merge 前需要进行 code review。 请运行以下命令进行 OpenCode review: 或者在 PR 页面评论 This is an automated reminder from PR Review Gate. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR1 — 后端一致性/性能/缓存基线
改动
invalidate_recommendations(),按前缀清recommend:*与today_summary缓存invalidate_recommendations(),负反馈立即生效(此前被拒论文最长 5min 仍留在推荐列表)get_by_id抛ValueError统一转 404(此前 500)Paper.rejected.is_(False),与推荐策略对齐async+run_in_threadpool+ 60s 缓存,避免全库 k-means/UMAP 阻塞 ASGI 事件循环paper_id改UUID校验;论文不存在转 404LIMIT(200/2000/500)防高被引 hub 无界扩张 OOM;候选加 rejected 过滤;去掉if not seed死代码(get_by_id已 raise)验证
invalidate_recommendations可导入pytest tests/test_import_smoke.py tests/test_repositories.py13 通过严重度
P0(负反馈延迟生效、500 错误、事件循环阻塞、OOM 风险)