This commit is contained in:
skiffer-git
2022-09-14 12:31:24 +08:00
parent e9ad462f9e
commit 60f0c80c36
4 changed files with 10 additions and 13 deletions
-2
View File
@@ -1,7 +1,6 @@
package config
import (
"fmt"
"io/ioutil"
"os"
"path/filepath"
@@ -545,7 +544,6 @@ type PDefaultTips struct {
func init() {
cfgName := os.Getenv("CONFIG_NAME")
fmt.Println("GET IM DEFAULT CONFIG PATH :", Root, "ENV PATH:", cfgName)
if len(cfgName) != 0 {
bytes, err := ioutil.ReadFile(filepath.Join(cfgName, "config", "config.yaml"))
if err != nil {
+2 -2
View File
@@ -77,7 +77,7 @@ func init() {
panic(err1.Error())
}
}
fmt.Println("0", utils.GetSelfFuncName(), "mongo driver client init success: ", uri)
fmt.Println("mongo driver client init success: ", uri)
// mongodb create index
if err := createMongoIndex(mongoClient, cSendLog, false, "send_id", "-send_time"); err != nil {
fmt.Println("send_id", "-send_time", "index create failed", err.Error())
@@ -100,7 +100,7 @@ func init() {
if err := createMongoIndex(mongoClient, cTag, true, "tag_id"); err != nil {
fmt.Println("tag_id", "index create failed", err.Error())
}
fmt.Println("create index success")
fmt.Println("createMongoIndex success")
DB.mongoClient = mongoClient
// redis pool init
@@ -12,11 +12,9 @@ import (
)
func init() {
//init managers
for k, v := range config.Config.Manager.AppManagerUid {
user, err := GetUserByUserID(v)
_, err := GetUserByUserID(v)
if err != nil {
fmt.Println("GetUserByUserID failed ", err.Error(), v, user)
} else {
continue
}
@@ -30,9 +28,10 @@ func init() {
appMgr.AppMangerLevel = constant.AppAdmin
err = UserRegister(appMgr)
if err != nil {
fmt.Println("AppManager insert error", err.Error(), appMgr, "time: ", appMgr.Birth.Unix())
fmt.Println("AppManager insert error ", err.Error(), appMgr)
} else {
fmt.Println("AppManager insert ", appMgr)
}
}
}