Skip to content

Commit ec34637

Browse files
committed
Merge branch 'feat/evaluation_doc_qa' of github.com:CaralHsi/MemOSRealPublic into feat/evaluation_doc_qa
2 parents 20af5d0 + 7e2adb4 commit ec34637

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed

src/memos/graph_dbs/polardb.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import json
22
import random
33
import textwrap
4+
import time
45

56
from contextlib import suppress
67
from 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):

src/memos/mem_scheduler/base_scheduler.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff 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)

0 commit comments

Comments
 (0)