Skip to content

RAGFlow is an agent-native database: a Retrieval-Augmented Generation (RAG) engine that grew into context infrastructure.

Refactor: better describe how to get prefix for sync data source (#11636)

Stephen Hud1e172171f5c
diff --git a/rag/svr/sync_data_source.py b/rag/svr/sync_data_source.py
index a5c4c4cfb4..fbe3722d5f 100644
--- a/rag/svr/sync_data_source.py
+++ b/rag/svr/sync_data_source.py
@@ -112,7 +112,7 @@ class SyncBase:
failed_docs += len(docs)
continue
- prefix = "[Jira] " if self.SOURCE_NAME == FileSource.JIRA else ""
+ prefix = self._get_source_prefix()
if failed_docs > 0:
logging.info(f"{prefix}{doc_num} docs synchronized till {next_update} ({failed_docs} skipped)")
else:
@@ -128,6 +128,9 @@ class SyncBase:
async def _generate(self, task: dict):
raise NotImplementedError
+
+ def _get_source_prefix(self):
+ return ""
class S3(SyncBase):
@@ -402,6 +405,9 @@ class GoogleDrive(SyncBase):
class Jira(SyncBase):
SOURCE_NAME: str = FileSource.JIRA
+ def _get_source_prefix(self):
+ return "[Jira]"
+
async def _generate(self, task: dict):
connector_kwargs = {
"jira_base_url": self.conf["base_url"],