fix:调整超时时间

This commit is contained in:
Mmx
2021-05-29 15:56:38 +08:00
parent 2b2df18e73
commit 9d81d18138
3 changed files with 3 additions and 3 deletions

2
.gitignore vendored
View File

@@ -1,4 +1,4 @@
.idea/
Mmx
Mmx*
Config.json
/GoBuilder.bat

View File

@@ -26,7 +26,7 @@ func Get(Url string, Query map[string]string) (string, error) {
resp, err := (&http.Client{
Transport: &http.Transport{
DialContext: (&net.Dialer{
Timeout: 30 * time.Second,
Timeout: 10 * time.Second,
Resolver: &net.Resolver{
PreferGo: true,
Dial: Util.NetDailEr(),

View File

@@ -64,7 +64,7 @@ func ErrHandler(err error) {
func NetDailEr() func(ctx context.Context, network, address string) (net.Conn, error) {
return func(ctx context.Context, network, address string) (net.Conn, error) {
d := net.Dialer{
Timeout: 20 * time.Second,
Timeout: 5 * time.Second,
}
return d.DialContext(ctx, "udp", Global.Config.Settings.Dns+":53")
}