Skip to content

Commit 54570da

Browse files
committed
refactor(knowledge.go): Modify the knowledge existence check condition to eliminate the parsing failure state
1 parent 7be2e99 commit 54570da

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

internal/application/repository/knowledge.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ func (r *knowledgeRepository) CheckKnowledgeExists(
118118
params *types.KnowledgeCheckParams,
119119
) (bool, *types.Knowledge, error) {
120120
query := r.db.WithContext(ctx).Model(&types.Knowledge{}).
121-
Where("tenant_id = ? AND knowledge_base_id = ? AND enable_status = ?", tenantID, kbID, "enabled")
121+
Where("tenant_id = ? AND knowledge_base_id = ? AND parse_status <> ?", tenantID, kbID, "failed")
122122

123123
if params.Type == "file" {
124124
// If file hash exists, prioritize exact match using hash

0 commit comments

Comments
 (0)