Skip to content

Commit 5a6f2bb

Browse files
committed
fix: SQL connection parsing error 2
1 parent 207d678 commit 5a6f2bb

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

veadk/memory/short_term_memory.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,10 @@ class ShortTermMemory(BaseModel):
7070
def model_post_init(self, __context: Any) -> None:
7171
if self.db_url:
7272
logger.info("The `db_url` is set, ignore `backend` option.")
73-
if self.db_url.count("@") > 1:
73+
if self.db_url.count("@") > 1 or self.db_url.count(":") > 2:
7474
logger.warning(
75-
"Multiple @ symbols detected in the database URL. "
76-
"Please encode `username/password` with `urllib.parse.quote_plus`. "
75+
"Multiple `@` or `:` symbols detected in the database URL. "
76+
"Please encode `username` or `password` with `urllib.parse.quote_plus`. "
7777
"Examples: p@ssword→p%40ssword."
7878
)
7979
self._session_service = DatabaseSessionService(db_url=self.db_url)

0 commit comments

Comments
 (0)