From 99870d8eaca89314aacae47e60c0de82fcdb50a7 Mon Sep 17 00:00:00 2001 From: Oleksii Kliukin Date: Wed, 18 Oct 2017 10:25:46 +0200 Subject: [PATCH] Fix division by zero when connecting to the DB. Apparently the retry function's first parameter is the duration of a single attempt and it cannot be zero. --- pkg/cluster/pg.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/cluster/pg.go b/pkg/cluster/pg.go index 582877fd9..edd672ebf 100644 --- a/pkg/cluster/pg.go +++ b/pkg/cluster/pg.go @@ -58,7 +58,7 @@ func (c *Cluster) initDbConn() error { } c.logger.Debug("new database connection") - err = retryutil.Retry(0, constants.PostgresConnectRetryTimeout, + err = retryutil.Retry(constants.PostgresConnectTimeout, constants.PostgresConnectRetryTimeout, func() (bool, error) { err := conn.Ping() if err == nil {