diff --git a/NEXT_CHANGELOG.md b/NEXT_CHANGELOG.md index 10a8c5ba2..98279f663 100644 --- a/NEXT_CHANGELOG.md +++ b/NEXT_CHANGELOG.md @@ -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 diff --git a/httpclient/api_client.go b/httpclient/api_client.go index d54fd3fb3..32a6b8e69 100644 --- a/httpclient/api_client.go +++ b/httpclient/api_client.go @@ -121,7 +121,7 @@ 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 @@ -129,9 +129,10 @@ func NewApiClient(cfg ClientConfig) *ApiClient { 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