fix:调整超时时间
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@@ -1,4 +1,4 @@
|
|||||||
.idea/
|
.idea/
|
||||||
Mmx
|
Mmx*
|
||||||
Config.json
|
Config.json
|
||||||
/GoBuilder.bat
|
/GoBuilder.bat
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ func Get(Url string, Query map[string]string) (string, error) {
|
|||||||
resp, err := (&http.Client{
|
resp, err := (&http.Client{
|
||||||
Transport: &http.Transport{
|
Transport: &http.Transport{
|
||||||
DialContext: (&net.Dialer{
|
DialContext: (&net.Dialer{
|
||||||
Timeout: 30 * time.Second,
|
Timeout: 10 * time.Second,
|
||||||
Resolver: &net.Resolver{
|
Resolver: &net.Resolver{
|
||||||
PreferGo: true,
|
PreferGo: true,
|
||||||
Dial: Util.NetDailEr(),
|
Dial: Util.NetDailEr(),
|
||||||
|
|||||||
@@ -64,7 +64,7 @@ func ErrHandler(err error) {
|
|||||||
func NetDailEr() func(ctx context.Context, network, address string) (net.Conn, error) {
|
func NetDailEr() func(ctx context.Context, network, address string) (net.Conn, error) {
|
||||||
return func(ctx context.Context, network, address string) (net.Conn, error) {
|
return func(ctx context.Context, network, address string) (net.Conn, error) {
|
||||||
d := net.Dialer{
|
d := net.Dialer{
|
||||||
Timeout: 20 * time.Second,
|
Timeout: 5 * time.Second,
|
||||||
}
|
}
|
||||||
return d.DialContext(ctx, "udp", Global.Config.Settings.Dns+":53")
|
return d.DialContext(ctx, "udp", Global.Config.Settings.Dns+":53")
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user