Skip to content

Commit

Permalink
fix benchmark s3 url
Browse files Browse the repository at this point in the history
  • Loading branch information
gavincabbage committed Sep 19, 2019
1 parent ff1d9b2 commit 37bb0f0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,6 @@ jobs:
AWS_ACCESS_KEY_ID: bogus
AWS_SECRET_KEY: bogus
AWS_REGION: us-east-1
AWS_ENDPOINT: http://s3:4572
AWS_ENDPOINT: http://localhost:${{ job.services.mariadb.ports['4572'] }}
POSTGRES_URL: postgres://postgres:password@localhost:${{ job.services.postgres.ports['5432'] }}/testdb?sslmode=disable

9 changes: 7 additions & 2 deletions support_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ import (
"github.com/aws/aws-sdk-go/service/s3/s3manager"
)

const (
retryLimit = 15
retryInterval = 3 * time.Second
)

type fataler interface {
Fatal(...interface{})
}
Expand All @@ -24,9 +29,9 @@ func newDB(f fataler, driver string, url string) *sql.DB {
f.Fatal(err)
}

for i := 0; i < 15; i++ {
for i := 0; i < retryLimit; i++ {
if err := db.Ping(); err != nil {
time.Sleep(3 * time.Second)
time.Sleep(retryInterval)
continue
}
break
Expand Down

0 comments on commit 37bb0f0

Please sign in to comment.