|
|
@ -54,6 +54,9 @@ func NewMongo() (*Mongo, error) {
|
|
|
|
defer cancel()
|
|
|
|
defer cancel()
|
|
|
|
mongoClient, err = mongo.Connect(ctx, options.Client().ApplyURI(uri))
|
|
|
|
mongoClient, err = mongo.Connect(ctx, options.Client().ApplyURI(uri))
|
|
|
|
if err == nil {
|
|
|
|
if err == nil {
|
|
|
|
|
|
|
|
if err = mongoClient.Ping(ctx, nil); err != nil {
|
|
|
|
|
|
|
|
return nil, errs.Wrap(err, uri)
|
|
|
|
|
|
|
|
}
|
|
|
|
return &Mongo{db: mongoClient}, nil
|
|
|
|
return &Mongo{db: mongoClient}, nil
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if shouldRetry(err) {
|
|
|
|
if shouldRetry(err) {
|
|
|
|