From cfde7bb0ff6d7441e3ae593016d6848b9e6af020 Mon Sep 17 00:00:00 2001 From: a3d21 <93191329+a3d21@users.noreply.github.com> Date: Fri, 29 Dec 2023 10:25:03 +0800 Subject: [PATCH] fix: mongo uri connect (#1611) --- pkg/common/db/unrelation/mongo.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkg/common/db/unrelation/mongo.go b/pkg/common/db/unrelation/mongo.go index 2c1dc6f38..8cfb97a98 100644 --- a/pkg/common/db/unrelation/mongo.go +++ b/pkg/common/db/unrelation/mongo.go @@ -74,6 +74,10 @@ func buildMongoURI() string { return uri } + if config.Config.Mongo.Uri != "" { + return config.Config.Mongo.Uri + } + username := os.Getenv("MONGO_USERNAME") password := os.Getenv("MONGO_PASSWORD") address := os.Getenv("MONGO_ADDRESS")