From 53a4b90d96d9dea42056da3dfb69c573313693f9 Mon Sep 17 00:00:00 2001 From: wenxu12345 <44203734@qq.com> Date: Mon, 21 Feb 2022 15:12:48 +0800 Subject: [PATCH] replace mongo driver --- pkg/common/db/model.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkg/common/db/model.go b/pkg/common/db/model.go index dada4137f..729e1323e 100644 --- a/pkg/common/db/model.go +++ b/pkg/common/db/model.go @@ -61,6 +61,10 @@ func init() { log.NewError(" mongo.Connect failed, try ", err.Error(), uri) time.Sleep(time.Duration(30) * time.Second) mongoClient, err1 = mongo.Connect(context.TODO(), options.Client().ApplyURI(uri)) + if err1 != nil { + log.NewError(" mongo.Connect failed, panic", err.Error(), uri) + panic(err1.Error()) + } mgoSession, err1 = mgo.DialWithInfo(mgoDailInfo) if err1 != nil { log.NewError(" mongo.Connect failed, panic", err.Error(), uri)