From a1ff15311a569ed2e16783535f0f3a6a49b3f35e Mon Sep 17 00:00:00 2001 From: tamirms Date: Fri, 30 Jul 2021 10:55:40 +0100 Subject: [PATCH] Fix logged message when horizon cannot open a db connection (#3792) 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. --- services/horizon/internal/init.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/horizon/internal/init.go b/services/horizon/internal/init.go index 901ac9a185..04755a0807 100644 --- a/services/horizon/internal/init.go +++ b/services/horizon/internal/init.go @@ -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)