Skip to content

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

Fix: add fields for logs. (#11039)

Kevin Huadbb8319e08e
diff --git a/api/db/services/connector_service.py b/api/db/services/connector_service.py
index bc54dc34bc..3e51289bf6 100644
--- a/api/db/services/connector_service.py
+++ b/api/db/services/connector_service.py
@@ -81,6 +81,7 @@ class SyncLogsService(CommonService):
cls.model.poll_range_end,
cls.model.new_docs_indexed,
cls.model.total_docs_indexed,
+ cls.model.error_msg,
cls.model.full_exception_trace,
cls.model.error_count,
Connector.name,
diff --git a/rag/svr/sync_data_source.py b/rag/svr/sync_data_source.py
index 8d62d6db6e..059155aca8 100644
--- a/rag/svr/sync_data_source.py
+++ b/rag/svr/sync_data_source.py
@@ -89,7 +89,7 @@ class SyncBase:
''.join(traceback.format_exception_only(None, ex)).strip(),
''.join(traceback.format_exception(None, ex, ex.__traceback__)).strip()
])
- SyncLogsService.update_by_id(task["id"], {"status": TaskStatus.FAIL, "full_exception_trace": msg})
+ SyncLogsService.update_by_id(task["id"], {"status": TaskStatus.FAIL, "full_exception_trace": msg, "error_msg": str(ex)})
SyncLogsService.schedule(task["connector_id"], task["kb_id"], task["poll_range_start"])