Skip to content

Commit 5c1c6c1

Browse files
committed
added check if database is reachable
1 parent ee3359e commit 5c1c6c1

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

cve-alert-fetcher/cmd/root.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ All parameters (such as access data) can be specified both on the command line a
7777
Msg("config variable cveDatabase.dataSourceName is not set")
7878
return
7979
}
80-
db, err = sqlx.Open(viper.GetString("cveDatabase.driverName"), viper.GetString("cveDatabase.dataSourceName"))
80+
db, err = sqlx.Connect(viper.GetString("cveDatabase.driverName"), viper.GetString("cveDatabase.dataSourceName"))
8181
if err != nil {
8282
log.Error().
8383
AnErr("Error", err).

cve-alert-restapi/cmd/root.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ All parameters (such as access data) can be specified both on the command line a
6464
Msg("config variable cveDatabase.dataSourceName is not set")
6565
return
6666
}
67-
db, err = sqlx.Open(viper.GetString("cveDatabase.driverName"), viper.GetString("cveDatabase.dataSourceName"))
67+
db, err = sqlx.Connect(viper.GetString("cveDatabase.driverName"), viper.GetString("cveDatabase.dataSourceName"))
6868
if err != nil {
6969
log.Error().
7070
AnErr("Error", err).

0 commit comments

Comments
 (0)