mysql ping
This commit is contained in:
parent
af9678f490
commit
eaf9974b55
|
@ -95,6 +95,11 @@ func NewMysql(cfg *conf.ConfigSt) (mysql *Mysql, err error) {
|
|||
mysql.dbVas.SetMaxOpenConns(20)
|
||||
mysql.dbVas.SetMaxIdleConns(10)
|
||||
|
||||
err = mysql.dbVas.Ping()
|
||||
if err != nil {
|
||||
logger.Error("MysqlDB ping fail, cfg: %v, db: %v, err: %v", util.ToJson(cfg.MixMongo), DatabaseVas, err)
|
||||
return
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue