fix:sync status idempotent

when RUNNING AND FINISHED cannot sync
This commit is contained in:
aries_ckt 2023-06-29 18:08:26 +08:00
parent 73b1863c69
commit d96000ef35

View File

@ -116,7 +116,7 @@ class KnowledgeService:
)
doc = knowledge_document_dao.get_knowledge_documents(query)[0]
if doc.status == SyncStatus.RUNNING.name or doc.status == SyncStatus.FINISHED.name:
raise Exception(f"RUNNING AND FINISHED doc:{doc.doc_name} can not sync")
raise Exception(f" doc:{doc.doc_name} status is {doc.status}, can not sync")
client = KnowledgeEmbedding(
knowledge_source=doc.content,
knowledge_type=doc.doc_type.upper(),