Merge log files

This commit is contained in:
wenxu12345
2022-03-31 11:28:51 +08:00
parent ecd2f0e2bf
commit 9fbfbfb23b
2 changed files with 5 additions and 2 deletions
+3 -1
View File
@@ -2,6 +2,7 @@ package db
import (
"Open_IM/pkg/common/config"
"Open_IM/pkg/common/constant"
"Open_IM/pkg/common/log"
"Open_IM/pkg/utils"
"fmt"
@@ -33,6 +34,7 @@ func key(dbAddress, dbName string) string {
}
func init() {
log.NewPrivateLog(constant.LogFileName)
//var mgoSession *mgo.Session
var mongoClient *mongo.Client
var err1 error
@@ -51,7 +53,7 @@ func init() {
}
mongoClient, err := mongo.Connect(context.TODO(), options.Client().ApplyURI(uri))
if err != nil{
if err != nil {
log.NewError(" mongo.Connect failed, try ", utils.GetSelfFuncName(), err.Error(), uri)
time.Sleep(time.Duration(30) * time.Second)
mongoClient, err1 = mongo.Connect(context.TODO(), options.Client().ApplyURI(uri))