|
@@ -19,7 +19,7 @@ func init() {
|
|
|
db, _ := orm.GetDB("default")
|
|
|
db.SetConnMaxLifetime(10 * time.Minute)
|
|
|
|
|
|
- if utils.MYSQL_URL_RDDP != ""{
|
|
|
+ if utils.MYSQL_URL_RDDP != "" {
|
|
|
_ = orm.RegisterDataBase("rddp", "mysql", utils.MYSQL_URL_RDDP)
|
|
|
orm.SetMaxIdleConns("rddp", 50)
|
|
|
orm.SetMaxOpenConns("rddp", 100)
|
|
@@ -28,7 +28,7 @@ func init() {
|
|
|
report_db.SetConnMaxLifetime(10 * time.Minute)
|
|
|
}
|
|
|
|
|
|
- if utils.MYSQL_URL_EDB != ""{
|
|
|
+ if utils.MYSQL_URL_EDB != "" {
|
|
|
_ = orm.RegisterDataBase("edb", "mysql", utils.MYSQL_URL_EDB)
|
|
|
orm.SetMaxIdleConns("edb", 50)
|
|
|
orm.SetMaxOpenConns("edb", 100)
|
|
@@ -37,8 +37,7 @@ func init() {
|
|
|
edb_db.SetConnMaxLifetime(10 * time.Minute)
|
|
|
}
|
|
|
|
|
|
-
|
|
|
- if utils.MYSQL_URL_DATA != ""{
|
|
|
+ if utils.MYSQL_URL_DATA != "" {
|
|
|
_ = orm.RegisterDataBase("data", "mysql", utils.MYSQL_URL_DATA)
|
|
|
orm.SetMaxIdleConns("data", 50)
|
|
|
orm.SetMaxOpenConns("data", 100)
|
|
@@ -48,7 +47,7 @@ func init() {
|
|
|
|
|
|
}
|
|
|
|
|
|
- if utils.MYSQL_URL_GL != ""{
|
|
|
+ if utils.MYSQL_URL_GL != "" {
|
|
|
_ = orm.RegisterDataBase("gl", "mysql", utils.MYSQL_URL_GL)
|
|
|
orm.SetMaxIdleConns("gl", 50)
|
|
|
orm.SetMaxOpenConns("gl", 100)
|
|
@@ -57,7 +56,7 @@ func init() {
|
|
|
gl.SetConnMaxLifetime(10 * time.Minute)
|
|
|
}
|
|
|
|
|
|
- if utils.MYSQL_URL_ETA != ""{
|
|
|
+ if utils.MYSQL_URL_ETA != "" {
|
|
|
_ = orm.RegisterDataBase("eta", "mysql", utils.MYSQL_URL_ETA)
|
|
|
orm.SetMaxIdleConns("eta", 50)
|
|
|
orm.SetMaxOpenConns("eta", 100)
|
|
@@ -66,7 +65,6 @@ func init() {
|
|
|
etaDb.SetConnMaxLifetime(10 * time.Minute)
|
|
|
}
|
|
|
|
|
|
-
|
|
|
orm.Debug = true
|
|
|
orm.DebugLog = orm.NewLog(utils.Binlog)
|
|
|
|
|
@@ -81,6 +79,9 @@ func init() {
|
|
|
|
|
|
// 智能研报数据表
|
|
|
initSmartReport()
|
|
|
+
|
|
|
+ // 初始化部分数据表变量(直接init会有顺序问题=_=!)
|
|
|
+ data_manage.InitEdbSourceVar()
|
|
|
}
|
|
|
|
|
|
// initEdbDataTable 注册Edb指标 数据表
|