|
|
@ -104,12 +104,11 @@ func buildMongoURI(config *config.GlobalConfig) string {
|
|
|
|
maxPoolSize = fmt.Sprint(config.Mongo.MaxPoolSize)
|
|
|
|
maxPoolSize = fmt.Sprint(config.Mongo.MaxPoolSize)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
uriFormat := "mongodb://%s/%s?maxPoolSize=%s"
|
|
|
|
uriFormat := fmt.Sprintf("mongodb://%s/%s?maxPoolSize=%s", address, database, maxPoolSize)
|
|
|
|
if username != "" && password != "" {
|
|
|
|
if username != "" && password != "" {
|
|
|
|
uriFormat = "mongodb://%s:%s@%s/%s?maxPoolSize=%s"
|
|
|
|
return fmt.Sprintf("mongodb://%s:%s@%s/%s?maxPoolSize=%s", username, password, address, database, maxPoolSize)
|
|
|
|
return fmt.Sprintf(uriFormat, username, password, address, database, maxPoolSize)
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return fmt.Sprintf(uriFormat, address, database, maxPoolSize)
|
|
|
|
return uriFormat
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
func shouldRetry(err error) bool {
|
|
|
|
func shouldRetry(err error) bool {
|
|
|
|