Fix: chunk number error after re-parsing (#8513)

### What problem does this PR solve?

Fix chunk number error after re-parsing. #8503.

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
Yongteng Lei
2025-06-26 17:46:53 +08:00
committed by GitHub
parent 05bf01b058
commit d768130204
2 changed files with 25 additions and 0 deletions

View File

@ -365,6 +365,13 @@ def run():
info["progress_msg"] = ""
info["chunk_num"] = 0
info["token_num"] = 0
e, doc = DocumentService.get_by_id(id)
if not e:
return get_data_error_result(message="Document not found!")
if doc.run == TaskStatus.DONE.value:
DocumentService.clear_chunk_num_when_rerun(doc.id)
DocumentService.update_by_id(id, info)
tenant_id = DocumentService.get_tenant_id(id)
if not tenant_id: