添加注释

This commit is contained in:
sk 2024-04-22 14:19:16 +08:00
parent ac7492c2db
commit a3b95947b0
1 changed files with 2 additions and 0 deletions

View File

@ -143,8 +143,10 @@ func newMgoSession(user, password, host string, port int32, options string) (s *
// [mongodb://][user:pass@]host1[:port1][,host2[:port2],...][/database][?options]
url := fmt.Sprintf("mongodb://%s%s:%d/admin%s", login, host, port, options)
//fmt.Println(url)
logger.Logger.Tracef("newMgoSession url:%s", url)
session, err := mgo.Dial(url)
if err != nil {
logger.Logger.Errorf("newMgoSession err:%v", err)
return nil, err
}
session.SetSafe(&mgo.Safe{})