Remove rate limiter on download client

This commit is contained in:
Ben Adrian Sarmiento
2024-07-13 20:20:46 +02:00
parent b99db626c9
commit 9b52681a78
2 changed files with 6 additions and 6 deletions

View File

@@ -57,10 +57,8 @@ func MainApp(configPath string) {
proxyURL = os.Getenv("PROXY")
}
dummyLimiter := http.NewRateLimiter(1000)
repoClient4 := http.NewHTTPClient("", 0, 1, false, []string{}, proxyURL, dummyLimiter, log.Named("network_test"))
repoClient6 := http.NewHTTPClient("", 0, 1, true, []string{}, proxyURL, dummyLimiter, log.Named("network_test"))
repoClient4 := http.NewHTTPClient("", 0, 1, false, []string{}, proxyURL, nil, log.Named("network_test"))
repoClient6 := http.NewHTTPClient("", 0, 1, true, []string{}, proxyURL, nil, log.Named("network_test"))
repo := http.NewIPRepository(repoClient4, repoClient6, "", log.Named("network_test"))
var hosts []string
@@ -112,7 +110,7 @@ func MainApp(configPath string) {
config.ShouldForceIPv6(),
hosts,
proxyURL,
rateLimiter,
nil,
log.Named("download_client"),
)

View File

@@ -157,7 +157,9 @@ func (r *HTTPClient) Do(req *http.Request) (*http.Response, error) {
r.ensureReachableHost(req)
}
r.rateLimiter.Wait()
if r.rateLimiter != nil {
r.rateLimiter.Wait()
}
resp, err = r.client.Do(req)