Skip to content
This repository has been archived by the owner on Aug 21, 2023. It is now read-only.

Commit

Permalink
dumpling/gcs: fix http client credential problem (#395) (#397)
Browse files Browse the repository at this point in the history
  • Loading branch information
ti-chi-bot authored Nov 23, 2021
1 parent bacccc0 commit 2d7ac73
Showing 1 changed file with 0 additions and 11 deletions.
11 changes: 0 additions & 11 deletions v4/export/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import (
"context"
"encoding/json"
"fmt"
"net/http"
"regexp"
"strconv"
"strings"
Expand Down Expand Up @@ -527,18 +526,8 @@ func (conf *Config) createExternalStorage(ctx context.Context) (storage.External
if err != nil {
return nil, errors.Trace(err)
}
httpClient := http.DefaultClient
httpClient.Timeout = 30 * time.Second
maxIdleConnsPerHost := http.DefaultMaxIdleConnsPerHost
if conf.Threads > maxIdleConnsPerHost {
maxIdleConnsPerHost = conf.Threads
}
transport := http.DefaultTransport.(*http.Transport).Clone()
transport.MaxIdleConnsPerHost = maxIdleConnsPerHost
httpClient.Transport = transport

return storage.New(ctx, b, &storage.ExternalStorageOptions{
HTTPClient: httpClient,
SkipCheckPath: true,
SendCredentials: false,
})
Expand Down

0 comments on commit 2d7ac73

Please sign in to comment.