Update read database path
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
This commit is contained in:
parent
3e5bf1d23d
commit
90346cefda
|
@ -3,6 +3,7 @@ package src
|
|||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"encoding/base64"
|
||||
|
||||
|
@ -20,7 +21,7 @@ var dbDevices *mongo.Collection
|
|||
var mongoClient *mongo.Client
|
||||
|
||||
func DbConnect() {
|
||||
mongoClient, err := mongo.Connect(context.TODO(), options.Client().ApplyURI(uri))
|
||||
mongoClient, err := mongo.Connect(context.TODO(), options.Client().ApplyURI(getMongoURI()))
|
||||
|
||||
if err != nil {
|
||||
panic(err)
|
||||
|
@ -70,7 +71,6 @@ func DbDisconnect() {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
func getMongoURI() string {
|
||||
dbPath := os.Getenv("GIN_DB_PATH")
|
||||
|
||||
|
|
Loading…
Reference in New Issue