Skip to content

Commit

Permalink
Fix logged message when horizon cannot open a db connection (#3792)
Browse files Browse the repository at this point in the history
Horizon logs a "cannot open Horizon DB" message when it fails to establish a database connection.
The problem is that this message is also logged when failing to open a connection to the Stellar Core DB.
This commit fixes the error message by specifying which database incurred the failure.
  • Loading branch information
tamirms authored Jul 30, 2021
1 parent 7a67fed commit a1ff153
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion services/horizon/internal/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (
func mustNewDBSession(subservice db.Subservice, databaseURL string, maxIdle, maxOpen int, registry *prometheus.Registry) db.SessionInterface {
session, err := db.Open("postgres", databaseURL)
if err != nil {
log.Fatalf("cannot open Horizon DB: %v", err)
log.Fatalf("cannot open %v DB: %v", subservice, err)
}

session.DB.SetMaxIdleConns(maxIdle)
Expand Down

0 comments on commit a1ff153

Please sign in to comment.