浏览代码

Merge pull request #13308 from lightsofapollo/issue-13307

Increase default connection timeout to 30s
Doug Davis 10 年之前
父节点
当前提交
dfc329d76a
共有 1 个文件被更改,包括 3 次插入2 次删除
  1. 3 2
      registry/registry.go

+ 3 - 2
registry/registry.go

@@ -52,8 +52,9 @@ func newClient(jar http.CookieJar, roots *x509.CertPool, certs []tls.Certificate
 	switch timeout {
 	case ConnectTimeout:
 		httpTransport.Dial = func(proto string, addr string) (net.Conn, error) {
-			// Set the connect timeout to 5 seconds
-			d := net.Dialer{Timeout: 5 * time.Second, DualStack: true}
+			// Set the connect timeout to 30 seconds to allow for slower connection
+			// times...
+			d := net.Dialer{Timeout: 30 * time.Second, DualStack: true}
 
 			conn, err := d.Dial(proto, addr)
 			if err != nil {