Merge branch 'dev-lwl/consul' into test
This commit is contained in:
commit
930e39e500
|
@ -54,9 +54,8 @@ import (
|
||||||
func Init(r *gin.Engine) {
|
func Init(r *gin.Engine) {
|
||||||
r.HandleMethodNotAllowed = true
|
r.HandleMethodNotAllowed = true
|
||||||
|
|
||||||
// websocket长链接
|
r.GET("/", HelloWorld)
|
||||||
r.GET("/", ServeFile)
|
r.POST("/", HelloWorld)
|
||||||
r.GET("/ws", HandleWs)
|
|
||||||
|
|
||||||
// healthcheck
|
// healthcheck
|
||||||
r.GET("/healthcheck", Healthcheck)
|
r.GET("/healthcheck", Healthcheck)
|
||||||
|
|
|
@ -108,7 +108,7 @@ func NewMysql(cfg *conf.ConfigSt) (mysql *Mysql, err error) {
|
||||||
|
|
||||||
mysql.dbVas, err = mysqldb.NewMysqlDB(cfg.MixMysql, DatabaseVas)
|
mysql.dbVas, err = mysqldb.NewMysqlDB(cfg.MixMysql, DatabaseVas)
|
||||||
if err != nil {
|
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
|
return
|
||||||
}
|
}
|
||||||
mysql.dbVas.SetMaxOpenConns(20)
|
mysql.dbVas.SetMaxOpenConns(20)
|
||||||
|
@ -116,13 +116,13 @@ func NewMysql(cfg *conf.ConfigSt) (mysql *Mysql, err error) {
|
||||||
|
|
||||||
err = mysql.dbVas.Ping()
|
err = mysql.dbVas.Ping()
|
||||||
if err != nil {
|
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
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
mysql.dbXxlJob, err = mysqldb.NewMysqlDB(cfg.MixMysql, DatabaseXxlJob)
|
mysql.dbXxlJob, err = mysqldb.NewMysqlDB(cfg.MixMysql, DatabaseXxlJob)
|
||||||
if err != nil {
|
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
|
return
|
||||||
}
|
}
|
||||||
mysql.dbXxlJob.SetMaxOpenConns(20)
|
mysql.dbXxlJob.SetMaxOpenConns(20)
|
||||||
|
@ -130,7 +130,7 @@ func NewMysql(cfg *conf.ConfigSt) (mysql *Mysql, err error) {
|
||||||
|
|
||||||
err = mysql.dbXxlJob.Ping()
|
err = mysql.dbXxlJob.Ping()
|
||||||
if err != nil {
|
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
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue