Skip to content

Commit

Permalink
added check if database is reachable
Browse files Browse the repository at this point in the history
  • Loading branch information
TheFireMike committed Apr 7, 2020
1 parent ee3359e commit 5c1c6c1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion cve-alert-fetcher/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ All parameters (such as access data) can be specified both on the command line a
Msg("config variable cveDatabase.dataSourceName is not set")
return
}
db, err = sqlx.Open(viper.GetString("cveDatabase.driverName"), viper.GetString("cveDatabase.dataSourceName"))
db, err = sqlx.Connect(viper.GetString("cveDatabase.driverName"), viper.GetString("cveDatabase.dataSourceName"))
if err != nil {
log.Error().
AnErr("Error", err).
Expand Down
2 changes: 1 addition & 1 deletion cve-alert-restapi/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ All parameters (such as access data) can be specified both on the command line a
Msg("config variable cveDatabase.dataSourceName is not set")
return
}
db, err = sqlx.Open(viper.GetString("cveDatabase.driverName"), viper.GetString("cveDatabase.dataSourceName"))
db, err = sqlx.Connect(viper.GetString("cveDatabase.driverName"), viper.GetString("cveDatabase.dataSourceName"))
if err != nil {
log.Error().
AnErr("Error", err).
Expand Down

0 comments on commit 5c1c6c1

Please sign in to comment.