mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-08 20:42:30 +08:00
Refactor: better describe how to get prefix for sync data source (#11636)
### What problem does this PR solve? better describe how to get prefix for sync data source ### Type of change - [x] Refactoring
This commit is contained in:
@ -112,7 +112,7 @@ class SyncBase:
|
|||||||
failed_docs += len(docs)
|
failed_docs += len(docs)
|
||||||
continue
|
continue
|
||||||
|
|
||||||
prefix = "[Jira] " if self.SOURCE_NAME == FileSource.JIRA else ""
|
prefix = self._get_source_prefix()
|
||||||
if failed_docs > 0:
|
if failed_docs > 0:
|
||||||
logging.info(f"{prefix}{doc_num} docs synchronized till {next_update} ({failed_docs} skipped)")
|
logging.info(f"{prefix}{doc_num} docs synchronized till {next_update} ({failed_docs} skipped)")
|
||||||
else:
|
else:
|
||||||
@ -128,6 +128,9 @@ class SyncBase:
|
|||||||
|
|
||||||
async def _generate(self, task: dict):
|
async def _generate(self, task: dict):
|
||||||
raise NotImplementedError
|
raise NotImplementedError
|
||||||
|
|
||||||
|
def _get_source_prefix(self):
|
||||||
|
return ""
|
||||||
|
|
||||||
|
|
||||||
class S3(SyncBase):
|
class S3(SyncBase):
|
||||||
@ -402,6 +405,9 @@ class GoogleDrive(SyncBase):
|
|||||||
class Jira(SyncBase):
|
class Jira(SyncBase):
|
||||||
SOURCE_NAME: str = FileSource.JIRA
|
SOURCE_NAME: str = FileSource.JIRA
|
||||||
|
|
||||||
|
def _get_source_prefix(self):
|
||||||
|
return "[Jira]"
|
||||||
|
|
||||||
async def _generate(self, task: dict):
|
async def _generate(self, task: dict):
|
||||||
connector_kwargs = {
|
connector_kwargs = {
|
||||||
"jira_base_url": self.conf["base_url"],
|
"jira_base_url": self.conf["base_url"],
|
||||||
|
|||||||
Reference in New Issue
Block a user