Feat: Hash doc id to avoid duplicate name. (#12573)

### What problem does this PR solve?

Feat: Hash doc id to avoid duplicate name. 

### Type of change

- [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
Magicbook1108
2026-01-15 14:02:15 +08:00
committed by GitHub
parent 9a10558f80
commit b40a7b2e7d
4 changed files with 18 additions and 4 deletions

View File

@ -36,6 +36,7 @@ from typing import Any
from flask import json
from api.utils.common import hash128
from api.db.services.connector_service import ConnectorService, SyncLogsService
from api.db.services.knowledgebase_service import KnowledgebaseService
from common import settings
@ -126,7 +127,7 @@ class SyncBase:
docs = []
for doc in document_batch:
d = {
"id": doc.id,
"id": hash128(doc.id),
"connector_id": task["connector_id"],
"source": self.SOURCE_NAME,
"semantic_identifier": doc.semantic_identifier,