File tree Expand file tree Collapse file tree 2 files changed +4
-8
lines changed
Expand file tree Collapse file tree 2 files changed +4
-8
lines changed Original file line number Diff line number Diff line change 11import json
22import random
33import textwrap
4+ import time
45
56from contextlib import suppress
67from datetime import datetime
@@ -152,7 +153,7 @@ def __init__(self, config: PolarDBGraphDBConfig):
152153 # Create connection pool
153154 self .connection_pool = psycopg2 .pool .ThreadedConnectionPool (
154155 minconn = 5 ,
155- maxconn = 2000 ,
156+ maxconn = 100 ,
156157 host = host ,
157158 port = port ,
158159 user = user ,
@@ -277,6 +278,8 @@ def _get_connection(self):
277278
278279 if attempt >= max_retries - 1 :
279280 raise RuntimeError (f"Failed to get a valid connection from pool: { e } " ) from e
281+ else :
282+ time .sleep (0.1 )
280283 continue
281284
282285 def _return_connection (self , connection ):
Original file line number Diff line number Diff line change @@ -180,13 +180,6 @@ def __init__(self, config: BaseSchedulerConfig):
180180 self .current_user_id : UserID | str | None = None
181181 self .current_mem_cube_id : MemCubeID | str | None = None
182182 self .current_mem_cube : BaseMemCube | None = None
183- try :
184- self .components = init_components ()
185- self .current_mem_cube : BaseMemCube = self .components ["naive_mem_cube" ]
186- except Exception :
187- logger .info (
188- "No environment available to initialize mem cube. Using fallback naive_mem_cube."
189- )
190183
191184 self ._mem_cubes : dict [str , BaseMemCube ] = {}
192185 self .auth_config_path : str | Path | None = self .config .get ("auth_config_path" , None )
You can’t perform that action at this time.
0 commit comments