Skip to content

Commit

Permalink
fix: error in db initialisation fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
pcvolkmer committed Dec 17, 2024
1 parent bc0521a commit 8bbf6af
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,10 @@ func main() {
TLSConfig: cli.Ssl,
}

db, dbErr := initDb(dbCfg)
if dbErr != nil {
if dbx, dbErr := initDb(dbCfg); dbErr == nil {
log.Fatalf("Cannot connect to Database: %s\n", dbErr.Error())
} else {
db = dbx
}
defer func(db *sql.DB) {
err := db.Close()
Expand Down

0 comments on commit 8bbf6af

Please sign in to comment.