Skip to content

Commit

Permalink
Revert "Add HTTP request burst management (#162)" (#164)
Browse files Browse the repository at this point in the history
This reverts commit 2962c1c.
  • Loading branch information
wilsonehusin authored Oct 16, 2024
1 parent a1e6e5f commit cca0384
Show file tree
Hide file tree
Showing 7 changed files with 56 additions and 233 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## 0.12.1

REVERTED:
* Reverted the client-side rate limiting and burst control ([#164](https://github.com/firehydrant/terraform-provider-firehydrant/pull/164))

## 0.12.0

ENHANCEMENTS:
Expand Down
4 changes: 0 additions & 4 deletions firehydrant/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ type APIClient struct {
baseURL string
token string
userAgentSuffix string
doer *RateLimitedHTTPDoer
}

const (
Expand Down Expand Up @@ -115,16 +114,13 @@ func NewRestClient(token string, opts ...OptFunc) (*APIClient, error) {
}
}

c.doer = NewRateLimitedHTTPDoer()

return c, nil
}

func (c *APIClient) client() *sling.Sling {
bi := GetBuildInfo()

return sling.New().Base(c.baseURL).
Doer(c.doer).
Set(
"User-Agent",
fmt.Sprintf(
Expand Down
4 changes: 0 additions & 4 deletions firehydrant/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import (
"github.com/bxcodec/faker/v3"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"golang.org/x/time/rate"
)

var (
Expand Down Expand Up @@ -76,9 +75,6 @@ func setupClient(requestPath string, mockedResponse interface{}, requestTests ..
return nil, nil, fmt.Errorf("could not generate rest client: %w", err)
}

// Don't perform client-side rate limiting in tests.
c.doer.WithLimiter(rate.NewLimiter(rate.Inf, 0))

teardown := func() {
ts.Close()
}
Expand Down
115 changes: 0 additions & 115 deletions firehydrant/httpclient.go

This file was deleted.

106 changes: 0 additions & 106 deletions firehydrant/httpclient_test.go

This file was deleted.

3 changes: 1 addition & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,20 @@ go 1.22.1

require (
github.com/bxcodec/faker/v3 v3.5.0
github.com/davecgh/go-spew v1.1.1
github.com/dghubble/sling v1.4.0
github.com/google/go-querystring v1.1.0
github.com/hashicorp/terraform-plugin-log v0.7.0
github.com/hashicorp/terraform-plugin-sdk/v2 v2.24.1
github.com/pkg/errors v0.9.1
github.com/senseyeio/duration v0.0.0-20180430131211-7c2a214ada46
github.com/stretchr/testify v1.7.2
golang.org/x/time v0.7.0
)

require (
github.com/agext/levenshtein v1.2.3 // indirect
github.com/apparentlymart/go-cidr v1.1.0 // indirect
github.com/apparentlymart/go-textseg/v13 v13.0.0 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/fatih/color v1.13.0 // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/google/go-cmp v0.5.9 // indirect
Expand Down
Loading

0 comments on commit cca0384

Please # to comment.