mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-12-03 02:42:19 +08:00
fix: changge the string ping format
This commit is contained in:
parent
261ea4706f
commit
39d5d3d89b
@ -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 {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user