Skip to content

Commit

Permalink
driver: Move timeout from package level to a function scope
Browse files Browse the repository at this point in the history
Conflicts with the `timeout` variable in `ha.go` file.
  • Loading branch information
yhabteab committed Mar 25, 2024
1 parent bcece45 commit 5659749
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions pkg/driver/driver.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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)

Expand Down

0 comments on commit 5659749

Please sign in to comment.