Remove rate limiter on download client
This commit is contained in:
@@ -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"),
|
||||
)
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user