fix: fix scripts functions upload

Signed-off-by: Xinwei Xiong (cubxxw) <3293172751nss@gmail.com>
pull/1721/head
Xinwei Xiong (cubxxw) 2 years ago
parent 4e4564c9cc
commit f9623807fb

@ -148,12 +148,18 @@ func checkMongo() (string, error) {
ctx, cancel := context.WithTimeout(context.Background(), mongoConnTimeout)
defer cancel()
str := "ths addr is:" + strings.Join(config.Config.Mongo.Address, ",")
client, err := mongo.Connect(ctx, options.Client().ApplyURI(uri))
if err != nil {
return "", err // Handle the error as needed
return "", errs.Wrap(errStr(err, str))
}
defer client.Disconnect(context.Background())
if err = client.Ping(context.TODO(), nil); err != nil {
return "", errs.Wrap(errStr(err, str))
}
ctx, cancel = context.WithTimeout(context.Background(), mongoConnTimeout)
defer cancel()

Loading…
Cancel
Save