mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-01-19 11:45:10 +08:00
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:
@ -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,
|
||||
|
||||
Reference in New Issue
Block a user