Skip to content
This repository was archived by the owner on Nov 5, 2024. It is now read-only.

Commit 0904f21

Browse files
committed
修复MongoDB参数不能保存的Bug
1 parent 71cb54d commit 0904f21

2 files changed

Lines changed: 2 additions & 1 deletion

File tree

teaconfigs/db/mongo.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ func (this *MongoConfig) Save() error {
117117
shared.Locker.Lock()
118118
defer shared.Locker.WriteUnlockNotify()
119119

120+
this.URI = this.ComposeURI()
120121
this.TeaVersion = teaconst.TeaVersion
121122
data, err := yaml.Marshal(this)
122123
if err != nil {

teadb/driver_mongo.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -644,7 +644,7 @@ func (this *MongoDriver) connect() (*mongo.Client, error) {
644644
return nil, err
645645
}
646646

647-
if sharedConfig != nil && len(sharedConfig.AuthMechanism) > 0 {
647+
if sharedConfig != nil && sharedConfig.AuthEnabled && len(sharedConfig.AuthMechanism) > 0 {
648648
opts.SetAuth(options.Credential{
649649
Username: sharedConfig.Username,
650650
Password: sharedConfig.Password,

0 commit comments

Comments
 (0)