tuoling805 1 жил өмнө
parent
commit
fcaae579b0
2 өөрчлөгдсөн 4 нэмэгдсэн , 3 устгасан
  1. 3 3
      models/db.go
  2. 1 0
      utils/config.go

+ 3 - 3
models/db.go

@@ -19,9 +19,6 @@ func init() {
 	db, _ := orm.GetDB("default")
 	db.SetConnMaxLifetime(10 * time.Minute)
 
-	orm.Debug = true
-	orm.DebugLog = orm.NewLog(utils.Binlog)
-
 	_ = orm.RegisterDataBase("rddp", "mysql", utils.MYSQL_URL_RDDP)
 	orm.SetMaxIdleConns("rddp", 50)
 	orm.SetMaxOpenConns("rddp", 100)
@@ -57,6 +54,9 @@ func init() {
 	etaDb, _ := orm.GetDB("eta")
 	etaDb.SetConnMaxLifetime(10 * time.Minute)
 
+	orm.Debug = true
+	orm.DebugLog = orm.NewLog(utils.Binlog)
+
 	// 注册Edb指标 数据表
 	initEdbDataTable()
 

+ 1 - 0
utils/config.go

@@ -130,6 +130,7 @@ func init() {
 	beego.Info(RunMode + " 模式")
 	MYSQL_URL = config["mysql_url"]
 	MYSQL_URL_RDDP = config["mysql_url_rddp"]
+
 	MYSQL_URL_EDB = config["mysql_url_edb"]
 	MYSQL_URL_DATA = config["mysql_url_data"]
 	MYSQL_URL_GL = config["mysql_url_gl"]