Skip to content

Commit e86a512

Browse files
committed
http默认超时5分钟
1 parent 52cc049 commit e86a512

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

http/client/client.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ func (c *HTTPClient) dial(network, addr string) (net.Conn, error) {
6262

6363
const (
6464
defaultRetryTimes = 3
65-
defaultTimeout = 15
65+
defaultTimeout = 300
6666
)
6767

6868
//New 创建一个带超时和重试控制的http client, 单位秒.
@@ -77,7 +77,7 @@ func New() *HTTPClient {
7777
return hc
7878
}
7979

80-
//Timeout 设置超时时间,单位:秒, 默认15秒.
80+
//Timeout 设置超时时间,单位:秒, 默认300秒.
8181
func (c *HTTPClient) Timeout(t int) *HTTPClient {
8282
c.timeout = time.Duration(t) * time.Second
8383
return c

0 commit comments

Comments
 (0)