Skip to content

Commit

Permalink
remove db disconnection logic
Browse files Browse the repository at this point in the history
  • Loading branch information
algo7 authored Feb 24, 2023
1 parent 70805b7 commit b6b0ffa
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions db/db.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ func Connect() *mongo.Client {
utils.ErrorHandler(err)
}

defer func() {
if err = client.Disconnect(context.TODO()); err != nil {
utils.ErrorHandler(err)
}
}()
// defer func() {
// if err = client.Disconnect(context.TODO()); err != nil {
// utils.ErrorHandler(err)
// }
// }()

// Send a ping to confirm a successful connection
if err := client.Ping(context.TODO(), readpref.Primary()); err != nil {
Expand Down

0 comments on commit b6b0ffa

Please sign in to comment.