Skip to content

Commit

Permalink
fix mongo client var name
Browse files Browse the repository at this point in the history
  • Loading branch information
benleb committed Jun 28, 2023
1 parent ac167c2 commit 3fe8293
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions internal/degendb/degendb.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,21 +24,21 @@ type DegenDB struct {
}

func NewDegenDB() *DegenDB {
mongo := connectToMongo()
if mongo == nil {
mongoClient := connectToMongo()
if mongoClient == nil {
log.Errorf("❌ could not connect to MongoDB at: %s", viper.GetString("mongodb.uri"))

return nil
}

// defer func() {
// if err := mongo.Disconnect(context.TODO()); err != nil {
// if err := mongoClient.Disconnect(context.TODO()); err != nil {
// panic(err)
// }
// }()

ddb := &DegenDB{
mongo: mongo,
mongo: mongoClient,
}

// cleanup & initialize
Expand Down

0 comments on commit 3fe8293

Please sign in to comment.