Update read database path
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
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…
x
Reference in New Issue
Block a user