Submitting tasks in a loop

This commit is contained in:
root 2024-10-29 14:28:57 +08:00
parent fc37e654fc
commit e2e5e0e22e

View File

@ -917,9 +917,11 @@ class DocumentService:
# trigger async task
if document_ids:
document_indexing_task.delay(dataset.id, document_ids)
for dociment_id in document_ids:
document_indexing_task.delay(dataset.id, [dociment_id])
if duplicate_document_ids:
duplicate_document_indexing_task.delay(dataset.id, duplicate_document_ids)
for duplicate_document_id in duplicate_document_ids:
duplicate_document_indexing_task.delay(dataset.id, [duplicate_document_id])
return documents, batch