diff options
Diffstat (limited to 'workhorse/internal/imageresizer/image_resizer.go')
-rw-r--r-- | workhorse/internal/imageresizer/image_resizer.go | 20 |
1 files changed, 2 insertions, 18 deletions
diff --git a/workhorse/internal/imageresizer/image_resizer.go b/workhorse/internal/imageresizer/image_resizer.go index cd0fa946530..8c3271b6f11 100644 --- a/workhorse/internal/imageresizer/image_resizer.go +++ b/workhorse/internal/imageresizer/image_resizer.go @@ -5,7 +5,6 @@ import ( "context" "fmt" "io" - "net" "net/http" "os" "os/exec" @@ -18,11 +17,11 @@ import ( "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/client_golang/prometheus/promauto" - "gitlab.com/gitlab-org/labkit/correlation" "gitlab.com/gitlab-org/labkit/tracing" "gitlab.com/gitlab-org/gitlab/workhorse/internal/config" "gitlab.com/gitlab-org/gitlab/workhorse/internal/helper" + "gitlab.com/gitlab-org/gitlab/workhorse/internal/helper/httptransport" "gitlab.com/gitlab-org/gitlab/workhorse/internal/log" "gitlab.com/gitlab-org/gitlab/workhorse/internal/senddata" ) @@ -69,23 +68,8 @@ const ( var envInjector = tracing.NewEnvInjector() -// Images might be located remotely in object storage, in which case we need to stream -// it via http(s) -var httpTransport = tracing.NewRoundTripper(correlation.NewInstrumentedRoundTripper(&http.Transport{ - Proxy: http.ProxyFromEnvironment, - DialContext: (&net.Dialer{ - Timeout: 30 * time.Second, - KeepAlive: 10 * time.Second, - }).DialContext, - MaxIdleConns: 2, - IdleConnTimeout: 30 * time.Second, - TLSHandshakeTimeout: 10 * time.Second, - ExpectContinueTimeout: 10 * time.Second, - ResponseHeaderTimeout: 30 * time.Second, -})) - var httpClient = &http.Client{ - Transport: httpTransport, + Transport: httptransport.New(), } const ( |