Skip to content

Commit

Permalink
fix: build issue
Browse files Browse the repository at this point in the history
  • Loading branch information
kasteph committed Oct 5, 2023
1 parent eeb02f5 commit 57ac365
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions storage/sql.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"sort"
"strings"

"github.com/cenkalti/backoff/v4"
backoff "github.com/cenkalti/backoff/v4"
"github.com/go-pg/pg/v10"
"github.com/go-pg/pg/v10/orm"
"github.com/go-pg/pg/v10/types"
Expand Down Expand Up @@ -229,14 +229,14 @@ func connect(ctx context.Context, opt *pg.Options) (*pg.DB, error) {
// db.AddQueryHook(&pgext.OpenTelemetryHook{})

// Check if connection credentials are valid and PostgreSQL is up and running.
if operation := func() error {
operation := func() error {
if err := db.Ping(ctx); err != nil {
return fmt.Errorf("ping database: %w", err)
}
return nil
}

retryErr := Retry(operation, NewExponentialBackoff())
retryErr := backoff.Retry(operation, backoff.NewExponentialBackOff())
if retryErr != nil {
return nil, fmt.Errorf("ping database retry attempt: %w", retryErr)
}
Expand Down

0 comments on commit 57ac365

Please sign in to comment.