This commit is contained in:
lwl0608 2024-05-16 22:26:06 +08:00
parent ca439f5cb6
commit 71f4a1e200
1 changed files with 4 additions and 4 deletions

View File

@ -108,7 +108,7 @@ func NewMysql(cfg *conf.ConfigSt) (mysql *Mysql, err error) {
mysql.dbVas, err = mysqldb.NewMysqlDB(cfg.MixMysql, DatabaseVas)
if err != nil {
logger.Error("NewMysqlDB fail, cfg: %v, db: %v, err: %v", util.ToJson(cfg.MixMongo), DatabaseVas, err)
logger.Error("NewMysqlDB fail, cfg: %v, db: %v, err: %v", util.ToJson(cfg.MixMysql), DatabaseVas, err)
return
}
mysql.dbVas.SetMaxOpenConns(20)
@ -116,13 +116,13 @@ func NewMysql(cfg *conf.ConfigSt) (mysql *Mysql, err error) {
err = mysql.dbVas.Ping()
if err != nil {
logger.Error("MysqlDB ping fail, cfg: %v, db: %v, err: %v", util.ToJson(cfg.MixMongo), DatabaseVas, err)
logger.Error("MysqlDB ping fail, cfg: %v, db: %v, err: %v", util.ToJson(cfg.MixMysql), DatabaseVas, err)
return
}
mysql.dbXxlJob, err = mysqldb.NewMysqlDB(cfg.MixMysql, DatabaseXxlJob)
if err != nil {
logger.Error("NewMysqlDB fail, cfg: %v, db: %v, err: %v", util.ToJson(cfg.MixMongo), DatabaseXxlJob, err)
logger.Error("NewMysqlDB fail, cfg: %v, db: %v, err: %v", util.ToJson(cfg.MixMysql), DatabaseXxlJob, err)
return
}
mysql.dbXxlJob.SetMaxOpenConns(20)
@ -130,7 +130,7 @@ func NewMysql(cfg *conf.ConfigSt) (mysql *Mysql, err error) {
err = mysql.dbXxlJob.Ping()
if err != nil {
logger.Error("MysqlDB ping fail, cfg: %v, db: %v, err: %v", util.ToJson(cfg.MixMongo), DatabaseXxlJob, err)
logger.Error("MysqlDB ping fail, cfg: %v, db: %v, err: %v", util.ToJson(cfg.MixMysql), DatabaseXxlJob, err)
return
}