Skip to content

Commit

Permalink
fix(hc-db-query): fixed possibily memory leak
Browse files Browse the repository at this point in the history
  • Loading branch information
Bhautik0110 committed Dec 21, 2023
1 parent 6702a97 commit a9423f9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ APP_ENV=local
# Database Config
DB_DIALECT=postgres
DB_HOST=localhost
DB_PORT=26257
DB_PORT=5432
DB_USERNAME=golang-api
DB_PASSWORD=golang-api
DB_NAME=golang-api
Expand Down
3 changes: 2 additions & 1 deletion controllers/api/v1/health_controller.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package v1

import (
"context"
"net/http"

"github.com/Improwised/golang-api/constants"
Expand Down Expand Up @@ -79,7 +80,7 @@ func (hc *HealthController) Db(ctx *fiber.Ctx) error {
//////////////////////

func healthDb(db *goqu.Database) error {
_, err := db.Query("SELECT 1")
_, err := db.ExecContext(context.TODO(), "SELECT 1")
if err != nil {
return err
}
Expand Down

0 comments on commit a9423f9

Please sign in to comment.