mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-12-03 02:42:19 +08:00
fix: fix scripts functions upload
Signed-off-by: Xinwei Xiong (cubxxw) <3293172751nss@gmail.com>
This commit is contained in:
parent
4e4564c9cc
commit
f9623807fb
@ -148,12 +148,18 @@ func checkMongo() (string, error) {
|
|||||||
ctx, cancel := context.WithTimeout(context.Background(), mongoConnTimeout)
|
ctx, cancel := context.WithTimeout(context.Background(), mongoConnTimeout)
|
||||||
defer cancel()
|
defer cancel()
|
||||||
|
|
||||||
|
str := "ths addr is:" + strings.Join(config.Config.Mongo.Address, ",")
|
||||||
|
|
||||||
client, err := mongo.Connect(ctx, options.Client().ApplyURI(uri))
|
client, err := mongo.Connect(ctx, options.Client().ApplyURI(uri))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", err // Handle the error as needed
|
return "", errs.Wrap(errStr(err, str))
|
||||||
}
|
}
|
||||||
defer client.Disconnect(context.Background())
|
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)
|
ctx, cancel = context.WithTimeout(context.Background(), mongoConnTimeout)
|
||||||
defer cancel()
|
defer cancel()
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user