diff --git a/tools/component/component.go b/tools/component/component.go index 285f2ecae..4e44bb7ba 100644 --- a/tools/component/component.go +++ b/tools/component/component.go @@ -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)