From 360e7b7071b233b5cb06bb8203cf859cc040f2c9 Mon Sep 17 00:00:00 2001 From: Alvar Penning Date: Thu, 11 Apr 2024 11:05:06 +0200 Subject: [PATCH] icingadb: Remove shouldRetry The additional check against a driver.ErrBadConn is now also part of retry.Retryable. Thus, it can be dropped. --- pkg/icingadb/driver.go | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/pkg/icingadb/driver.go b/pkg/icingadb/driver.go index ac5af7e1d..abb6ed713 100644 --- a/pkg/icingadb/driver.go +++ b/pkg/icingadb/driver.go @@ -52,7 +52,7 @@ func (c RetryConnector) Connect(ctx context.Context) (driver.Conn, error) { return }, - shouldRetry, + retry.Retryable, backoff.NewExponentialWithJitter(time.Millisecond*128, time.Minute*1), retry.Settings{ Timeout: retry.DefaultTimeout, @@ -88,11 +88,3 @@ type MysqlFuncLogger func(v ...interface{}) func (log MysqlFuncLogger) Print(v ...interface{}) { log(v) } - -func shouldRetry(err error) bool { - if errors.Is(err, driver.ErrBadConn) { - return true - } - - return retry.Retryable(err) -}