⚡ 让工作台 work-buffer 轮询只查进行中条目、无变化不写库 #63
Loading…
x
Reference in New Issue
Block a user
No description provided.
Delete Branch "claude/work-buffer-query"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
为什么
标注工作台每 3 秒轮询一次
GET /api/plugins/annotation-qa/work-buffer。线上 2026-10-27 的 3 小时 20 分钟内,超过 1 秒的慢请求有 4,407 条,其中 4,095 条来自这个接口。work_buffer_latency日志显示,耗时主要花在存储层:store_ms p50 为 556ms,历史多的用户约 800ms,历史少的约 100ms。原因有两个:
assignedUserId OR latestAuthorUserId,会把这个人做过的全部历史条目都读出来,所以耗时随历史量线性增长。改了什么(
internal/store/annotation_work_buffer.go)AnnotationView: "active":只查分配给本人、处于标注阶段、状态为 claimed/in_progress/rework 的条目。它覆盖occupiesAnnotationBuffer判定的全部条目,后续仍按原逻辑过滤,所以结果不变。不改 API、数据格式和索引。
验证
TestMongoAnnotationWorkBufferPollIsReadOnly(需设ANNOTATION_BUFFER_MONGO_STORE=1,使用本地 27018):TestAnnotationBufferMongoHTTPConcurrencyAndReceipt(两个 API 实例并发领取和回执重放)通过。npm run test:go:gate:68 个失败全部在基线内,没有新增失败。未验证
work_buffer_latency日志里的 store_ms。🤖 Generated with Claude Code