mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-19 02:37:24 +08:00
Merge pull request #7615 from swordqiu/hotfix/qj-get-default-http-client-always-new-instance
fix: GetDefaultClient always return a new http client instance
This commit is contained in:
@@ -215,7 +215,7 @@ func (b *EtcdBackend) shouldDeleteWatchedResource(ctx context.Context, keywordPl
|
||||
clientsKey := fmt.Sprintf("/%s/%s", keywordPlural, EtcdInformerClientsKey)
|
||||
pairs, err := b.client.List(ctx, clientsKey)
|
||||
if err != nil {
|
||||
log.Errorf("list clientsKey %s error: %v", err)
|
||||
log.Errorf("list clientsKey %s error: %v", clientsKey, err)
|
||||
return false
|
||||
}
|
||||
return len(pairs) == 0
|
||||
|
||||
@@ -411,11 +411,11 @@ func GetAdaptiveTimeoutClient() *http.Client {
|
||||
var defaultHttpClient *http.Client
|
||||
|
||||
func init() {
|
||||
defaultHttpClient = GetClient(true, time.Second*15)
|
||||
defaultHttpClient = GetDefaultClient()
|
||||
}
|
||||
|
||||
func GetDefaultClient() *http.Client {
|
||||
return defaultHttpClient
|
||||
return GetClient(true, time.Second*15)
|
||||
}
|
||||
|
||||
func Request(client *http.Client, ctx context.Context, method THttpMethod, urlStr string, header http.Header, body io.Reader, debug bool) (*http.Response, error) {
|
||||
|
||||
Reference in New Issue
Block a user