mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-12-10 23:07:30 +08:00
mogodb url connent
This commit is contained in:
parent
ed4840dd39
commit
ed5a07ca18
@ -157,12 +157,12 @@ func checkMysql() error {
|
||||
|
||||
func checkMongo() error {
|
||||
var client *mongo.Client
|
||||
uri := "mongodb://sample.host:27017/?maxPoolSize=20&w=majority"
|
||||
defer func() {
|
||||
if client != nil {
|
||||
client.Disconnect(context.TODO())
|
||||
}
|
||||
}()
|
||||
uri := "mongodb://sample.host:27017/?maxPoolSize=20&w=majority"
|
||||
if config.Config.Mongo.Uri != "" {
|
||||
uri = config.Config.Mongo.Uri
|
||||
} else {
|
||||
@ -188,7 +188,6 @@ func checkMongo() error {
|
||||
if err != nil {
|
||||
return errs.Wrap(err)
|
||||
} else {
|
||||
//err = client.Ping(context.TODO(), &readpref.ReadPref{})
|
||||
err = client.Ping(context.TODO(), nil)
|
||||
if err != nil {
|
||||
return errs.Wrap(err)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user