RAGFlow is an agent-native database: a Retrieval-Augmented Generation (RAG) engine that grew into context infrastructure.
Go agent-harnessagent-native-databaseagentic-aiagentic-retrievalagentic-searchaiai-agentscontext-enginecontext-engineeringcontext-managementharness-engineeringknowledge-compilationragretrieval-augmented-generationretrieval-harnesssearch-harness
fix: Add proper error handling for database reconnection attempts (#12650)
Mohan0a8eb11c3db2
diff --git a/api/db/db_models.py b/api/db/db_models.pyindex 080613b84c..cdd986c48e 100644--- a/api/db/db_models.py+++ b/api/db/db_models.py@@ -281,7 +281,11 @@ class RetryingPooledMySQLDatabase(PooledMySQLDatabase):except Exception as e:logging.error(f"Failed to reconnect: {e}")time.sleep(0.1)- self.connect()+ try:+ self.connect()+ except Exception as e2:+ logging.error(f"Failed to reconnect on second attempt: {e2}")+ raisedef begin(self):for attempt in range(self.max_retries + 1):@@ -352,7 +356,11 @@ class RetryingPooledPostgresqlDatabase(PooledPostgresqlDatabase):except Exception as e:logging.error(f"Failed to reconnect to PostgreSQL: {e}")time.sleep(0.1)- self.connect()+ try:+ self.connect()+ except Exception as e2:+ logging.error(f"Failed to reconnect to PostgreSQL on second attempt: {e2}")+ raisedef begin(self):for attempt in range(self.max_retries + 1):