Skip to content

Commit

Permalink
minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
mkabilov committed Oct 17, 2017
1 parent c0760a2 commit 4eb549c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pkg/cluster/pg.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ func (c *Cluster) initDbConn() error {
return err
}

c.logger.Debug("new database connection")
err = retryutil.Retry(0, constants.PostgresConnectRetryTimeout,
func() (bool, error) {
err := conn.Ping()
Expand All @@ -66,6 +67,7 @@ func (c *Cluster) initDbConn() error {

if err2 := conn.Close(); err2 != nil {
c.logger.Errorf("error when closing PostgreSQL connection after another error: %v", err2)
return false, err2
}

if _, ok := err.(*net.OpError); ok {
Expand All @@ -77,7 +79,6 @@ func (c *Cluster) initDbConn() error {
if err != nil {
return fmt.Errorf("could not init db connection: %v", err)
}
c.logger.Debug("new database connection")

c.pgDb = conn

Expand Down

0 comments on commit 4eb549c

Please sign in to comment.