数据库管理器单例模式
This commit is contained in:
5
robot.py
5
robot.py
@@ -74,9 +74,10 @@ class Robot(Job):
|
||||
|
||||
self.wxid = self.wcf.get_self_wxid()
|
||||
self.allContacts = self.get_all_contacts()
|
||||
# 修改初始化方法中的这一部分
|
||||
self.LOG.info(f"DB+REDIS 连接池开始初始化")
|
||||
# 初始化数据库连接管理器
|
||||
self.db_manager = DBConnectionManager(
|
||||
# 使用单例模式获取实例
|
||||
self.db_manager = DBConnectionManager.get_instance(
|
||||
mysql_config=self.config.mariadb,
|
||||
redis_config=self.config.redis
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user