From 565974929d807d62101b92bf0cb97a33948b3429 Mon Sep 17 00:00:00 2001 From: Yonas Habteab Date: Mon, 25 Mar 2024 10:40:16 +0100 Subject: [PATCH] driver: Move `timeout` from package level to a function scope Conflicts with the `timeout` variable in `ha.go` file. --- pkg/driver/driver.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/pkg/driver/driver.go b/pkg/driver/driver.go index 30f0f307f..4615ab6ef 100644 --- a/pkg/driver/driver.go +++ b/pkg/driver/driver.go @@ -21,8 +21,6 @@ const ( PostgreSQL string = "postgres" ) -var timeout = time.Minute * 5 - type InitConnFunc func(context.Context, driver.Conn) error // RetryConnector wraps driver.Connector with retry logic. @@ -57,7 +55,7 @@ func (c RetryConnector) Connect(ctx context.Context) (driver.Conn, error) { shouldRetry, backoff.NewExponentialWithJitter(time.Millisecond*128, time.Minute*1), retry.Settings{ - Timeout: timeout, + Timeout: time.Minute * 5, OnError: func(_ time.Duration, _ uint64, err, lastErr error) { telemetry.UpdateCurrentDbConnErr(err)