chang code

This commit is contained in:
ziming 2025-05-23 11:43:44 +08:00
parent 9f2e438ab6
commit 07641871f2
1 changed files with 1 additions and 9 deletions

View File

@ -6,7 +6,6 @@ import (
"fmt" "fmt"
"io" "io"
"net/http" "net/http"
"time"
) )
type Options struct { type Options struct {
@ -28,14 +27,7 @@ func NewOptions(options ...Option) *Options {
return code == http.StatusOK return code == http.StatusOK
}, },
HttpClient: &http.Client{ HttpClient: http.DefaultClient,
Timeout: 10 * time.Second,
Transport: &http.Transport{
MaxIdleConns: 10, // 最大空闲连接数
MaxIdleConnsPerHost: 5, // 每个主机的最大空闲连接数
IdleConnTimeout: 10 * time.Second, // 空闲连接超时时间
},
},
} }
for _, option := range options { for _, option := range options {