fix: mongo

This commit is contained in:
withchao
2024-01-10 10:18:05 +08:00
parent 86aebfc0bd
commit f0075265d5
2 changed files with 4 additions and 4 deletions
+2 -2
View File
@@ -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)
}