mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-04-06 04:15:46 +08:00
fix: mongo
This commit is contained in:
parent
86aebfc0bd
commit
f0075265d5
@ -103,9 +103,9 @@ func buildMongoURI() string {
|
||||
maxPoolSize = fmt.Sprint(config.Config.Mongo.MaxPoolSize)
|
||||
}
|
||||
|
||||
uriFormat := "mongodb://%s/%s?maxPoolSize=%s&authSource=admin"
|
||||
uriFormat := "mongodb://%s/%s?maxPoolSize=%s"
|
||||
if username != "" && password != "" {
|
||||
uriFormat = "mongodb://%s:%s@%s/%s?maxPoolSize=%s&authSource=admin"
|
||||
uriFormat = "mongodb://%s:%s@%s/%s?maxPoolSize=%s"
|
||||
return fmt.Sprintf(uriFormat, username, password, address, database, maxPoolSize)
|
||||
}
|
||||
return fmt.Sprintf(uriFormat, address, database, maxPoolSize)
|
||||
|
@ -171,10 +171,10 @@ func buildMongoURI() string {
|
||||
mongodbHosts := strings.Join(config.Config.Mongo.Address, ",")
|
||||
|
||||
if username != "" && password != "" {
|
||||
return fmt.Sprintf("mongodb://%s:%s@%s/%s?maxPoolSize=%d&authSource=admin",
|
||||
return fmt.Sprintf("mongodb://%s:%s@%s/%s?maxPoolSize=%d",
|
||||
username, password, mongodbHosts, database, maxPoolSize)
|
||||
}
|
||||
return fmt.Sprintf("mongodb://%s/%s?maxPoolSize=%d&authSource=admin",
|
||||
return fmt.Sprintf("mongodb://%s/%s?maxPoolSize=%d",
|
||||
mongodbHosts, database, maxPoolSize)
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user