optimize the knowledge failed documents query (#3870)

Co-authored-by: luowei <glpat-EjySCyNjWiLqAED-YmwM>
Co-authored-by: crazywoola <427733928@qq.com>
Co-authored-by: crazywoola <100913391+crazywoola@users.noreply.github.com>
This commit is contained in:
Charlie.Wei 2024-04-26 11:47:23 +08:00 committed by GitHub
parent 7919596a21
commit f62b2b5b45
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -418,9 +418,8 @@ class DocumentService:
def get_error_documents_by_dataset_id(dataset_id: str) -> list[Document]:
documents = db.session.query(Document).filter(
Document.dataset_id == dataset_id,
Document.indexing_status == 'error' or Document.indexing_status == 'paused'
Document.indexing_status.in_(['error', 'paused'])
).all()
return documents
@staticmethod