fix: make document retry batches consistent (#39978)

Co-authored-by: caosurong <surong.cao@thinkingdata.cn>
This commit is contained in:
csurong
2026-08-06 02:01:14 +00:00
committed by GitHub
co-authored by caosurong
parent b6b3e747f3
commit f7881bb635
5 changed files with 251 additions and 33 deletions
@@ -1441,9 +1441,11 @@ class DocumentRetryApi(DocumentResource):
retry_documents = []
if not dataset:
raise NotFound("Dataset not found.")
documents = DocumentService.get_documents_by_ids(dataset.id, payload.document_ids, session)
documents_by_id = {document.id: document for document in documents}
for document_id in payload.document_ids:
try:
document = DocumentService.get_document(dataset.id, document_id, session=session)
document = documents_by_id.get(document_id)
# 404 if document not found
if document is None: