Fix doc progress issue. (#4520)

### What problem does this PR solve?

#4516
### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
Kevin Hu 2025-01-17 18:28:15 +08:00 committed by GitHub
parent 69984554a5
commit f4d084bcf1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -723,7 +723,7 @@ def stop_parsing(tenant_id, dataset_id):
doc = DocumentService.query(id=id, kb_id=dataset_id) doc = DocumentService.query(id=id, kb_id=dataset_id)
if not doc: if not doc:
return get_error_data_result(message=f"You don't own the document {id}.") return get_error_data_result(message=f"You don't own the document {id}.")
if int(doc[0].progress) == 1 or int(doc[0].progress) == 0: if int(doc[0].progress) == 1 or doc[0].progress == 0:
return get_error_data_result( return get_error_data_result(
"Can't stop parsing document with progress at 0 or 1" "Can't stop parsing document with progress at 0 or 1"
) )