refactor(knowledge.go): Modify the knowledge existence check condition to eliminate the parsing failure state

main
begoniezhao 2025-08-29 17:40:20 +08:00
parent 7be2e99aa2
commit 54570da047
1 changed files with 1 additions and 1 deletions

View File

@ -118,7 +118,7 @@ func (r *knowledgeRepository) CheckKnowledgeExists(
params *types.KnowledgeCheckParams,
) (bool, *types.Knowledge, error) {
query := r.db.WithContext(ctx).Model(&types.Knowledge{}).
Where("tenant_id = ? AND knowledge_base_id = ? AND enable_status = ?", tenantID, kbID, "enabled")
Where("tenant_id = ? AND knowledge_base_id = ? AND parse_status <> ?", tenantID, kbID, "failed")
if params.Type == "file" {
// If file hash exists, prioritize exact match using hash