From bdf410d4d1576d3b0e0b191704d61160e71f64e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pa=CC=88r=20Karlsson?= Date: Sun, 2 Aug 2015 01:18:22 +0200 Subject: [PATCH] Added generic ping check to probe for active db connection --- main.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/main.go b/main.go index d4a201ac..bdaf0d71 100644 --- a/main.go +++ b/main.go @@ -60,10 +60,8 @@ func Open(dialect string, args ...interface{}) (DB, error) { } dbSql, err = sql.Open(driver, source) - // For some reason, postgres does not throw an connection error. - // Sending a ping request after the connection is made is a quick workaround for this - if driver == "postgres" && err == nil { - err = db.DB().Ping() + if err == nil { + err = db.DB().Ping() // Send a ping to make sure the database connection is alive. } case sqlCommon: