新增同步存储方法;新增run_server.py文件;修改默认的数据库连接方式;
This commit is contained in:
@@ -17,8 +17,7 @@ class Database:
|
||||
def init_pool(self, db_name=None):
|
||||
"""Initialize the connection pool."""
|
||||
# Use provided db_name, or the one from constructor, or default from config
|
||||
target_db_name = db_name or self.db_name
|
||||
conn_string = postgresql_info.get_pgconn_string(db_name=target_db_name)
|
||||
conn_string = postgresql_info.get_pgconn_string()
|
||||
try:
|
||||
self.pool = psycopg_pool.AsyncConnectionPool(
|
||||
conninfo=conn_string,
|
||||
@@ -28,7 +27,7 @@ class Database:
|
||||
kwargs={"row_factory": dict_row}, # Return rows as dictionaries
|
||||
)
|
||||
logger.info(
|
||||
f"PostgreSQL connection pool initialized for database: {target_db_name or 'default'}"
|
||||
f"PostgreSQL connection pool initialized for database: 'default'"
|
||||
)
|
||||
except Exception as e:
|
||||
logger.error(f"Failed to initialize postgresql connection pool: {e}")
|
||||
|
||||
Reference in New Issue
Block a user