真实请求 POST /api/v1/library/captures 一律 500:拼出来的 "library-capture-<scope>-<nano>" 是 45 个字符,而 jobs.id 是 varchar(36), PG 直接拒绝(value too long)。此前页面一直停在"未接线",这条路径从没被 真实请求覆盖过,所以只有接上 agent 之后才暴露。 改为 libcap-<scope>-<nano>(35 字符),并用测试锁住列宽与形状。 试过:go test ./internal/httpapi -run LibraryCapture 全绿;修复前用真实 DATABASE_URL 复现 enqueue error: value too long for type character varying(36)。
This commit is contained in:
@@ -97,7 +97,10 @@ func libraryCaptureEnqueue(w http.ResponseWriter, r *http.Request, config Config
|
||||
}
|
||||
}
|
||||
}
|
||||
requestedID := fmt.Sprintf("library-capture-%s-%d", request.Scope, now.UnixNano())
|
||||
// 队列作业 id 落进 jobs.id(varchar(36)):原来拼 "library-capture-<scope>-<nano>"
|
||||
// 是 45 个字符,真实请求 100% 被 PG 拒(value too long)——只是页面一直停在
|
||||
// "未接线"上,没人走到这里。这里按列宽拼短 id,并留出 scope 全称。
|
||||
requestedID := fmt.Sprintf("libcap-%s-%d", request.Scope, now.UnixNano())
|
||||
// The idempotency key is the capture job id: the same logical capture must map
|
||||
// to one queue row. Binding the scope into the key would silently create a
|
||||
// second job instead of reporting a conflicting request, so the conflict is
|
||||
|
||||
Reference in New Issue
Block a user