Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions NEXT_CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
## Release v0.84.0

### New Features and Improvements
* Increased rate limiter burst setting from 1 to rate\_limit value.

### Bug Fixes

Expand Down
5 changes: 3 additions & 2 deletions httpclient/api_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,17 +121,18 @@ func NewApiClient(cfg ClientConfig) *ApiClient {
cfg.ErrorRetriable = DefaultErrorRetriable
}
transport := cfg.httpTransport()
rateLimit := rate.Limit(orDefault(cfg.RateLimitPerSecond, 15))
rateLimit := rate.Limit(cfg.RateLimitPerSecond)
// depend on the HTTP fixture interface to prevent any coupling
if skippable, ok := transport.(interface {
SkipRetryOnIO() bool
}); ok && skippable.SkipRetryOnIO() {
rateLimit = rate.Inf
cfg.RetryTimeout = 0
}

return &ApiClient{
config: cfg,
rateLimiter: rate.NewLimiter(rateLimit, 1),
rateLimiter: rate.NewLimiter(rateLimit, cfg.RateLimitPerSecond),
httpClient: &http.Client{
// We deal with request timeouts ourselves such that we do not
// time out during request or response body reads that make
Expand Down
Loading