mirror of
https://github.com/csunny/DB-GPT.git
synced 2025-08-01 08:11:45 +00:00
add LOCAL_DB_SSL_VERIFY for Supporting TiDB serverless (#2308)
This commit is contained in:
parent
8bb2a15f05
commit
1a6ad50b3d
@ -215,6 +215,7 @@ class Config(metaclass=Singleton):
|
||||
self.LOCAL_DB_PASSWORD = os.getenv("LOCAL_DB_PASSWORD", "aa123456")
|
||||
self.LOCAL_DB_POOL_SIZE = int(os.getenv("LOCAL_DB_POOL_SIZE", 10))
|
||||
self.LOCAL_DB_POOL_OVERFLOW = int(os.getenv("LOCAL_DB_POOL_OVERFLOW", 20))
|
||||
self.LOCAL_DB_SSL_VERIFY = bool(os.getenv("LOCAL_DB_SSL_VERIFY", False))
|
||||
|
||||
self.CHAT_HISTORY_STORE_TYPE = os.getenv("CHAT_HISTORY_STORE_TYPE", "db")
|
||||
|
||||
|
@ -122,6 +122,8 @@ def _initialize_db(
|
||||
f"{str(CFG.LOCAL_DB_PORT)}/"
|
||||
f"{db_name}?charset=utf8mb4"
|
||||
)
|
||||
if CFG.LOCAL_DB_SSL_VERIFY:
|
||||
db_url += "&ssl_verify_cert=true&ssl_verify_identity=true"
|
||||
# Try to create database, if failed, will raise exception
|
||||
_create_mysql_database(db_name, db_url, try_to_create_db)
|
||||
elif CFG.LOCAL_DB_TYPE == DBType.OceanBase.value():
|
||||
|
Loading…
Reference in New Issue
Block a user