From 6734bb64ec5d6ec968423179105f2a02e35cb160 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=B1=E5=A4=A7=E6=B4=8B?= <714403855@qq.com> Date: Tue, 16 Dec 2025 19:24:23 +0800 Subject: [PATCH] optimize --- src/memos/graph_dbs/polardb.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/memos/graph_dbs/polardb.py b/src/memos/graph_dbs/polardb.py index d9f5fadcb..018911db2 100644 --- a/src/memos/graph_dbs/polardb.py +++ b/src/memos/graph_dbs/polardb.py @@ -252,7 +252,7 @@ def _get_connection(self): if attempt < max_retries - 1: # Exponential backoff: 0.1s, 0.2s, 0.4s """time.sleep(0.1 * (2**attempt))""" - time.sleep(0.01) + time.sleep(0.003) continue else: raise RuntimeError("Pool returned a closed connection after all retries") @@ -284,7 +284,7 @@ def _get_connection(self): if attempt < max_retries - 1: # Exponential backoff: 0.1s, 0.2s, 0.4s """time.sleep(0.1 * (2**attempt))""" - time.sleep(0.01) + time.sleep(0.003) continue else: raise RuntimeError( @@ -317,7 +317,7 @@ def _get_connection(self): wait_time = 0.5 * (2**attempt) logger.info(f"[_get_connection] Waiting {wait_time}s before retry...") """time.sleep(wait_time)""" - time.sleep(0.01) + time.sleep(0.003) continue else: raise RuntimeError( @@ -329,7 +329,7 @@ def _get_connection(self): # Other pool errors - retry with normal backoff if attempt < max_retries - 1: """time.sleep(0.1 * (2**attempt))""" - time.sleep(0.01) + time.sleep(0.003) continue else: raise RuntimeError( @@ -356,7 +356,7 @@ def _get_connection(self): else: # Exponential backoff: 0.1s, 0.2s, 0.4s """time.sleep(0.1 * (2**attempt))""" - time.sleep(0.01) + time.sleep(0.003) continue # Should never reach here, but just in case