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