mirror of
https://github.com/duanhf2012/origin.git
synced 2026-02-04 06:54:45 +08:00
修复HTTPClient超时不反回问题,并提供设置超时时间接口
This commit is contained in:
@@ -64,9 +64,14 @@ func (slf *HttpClientModule) Init(maxpool int, proxyUrl string) {
|
||||
Proxy: proxyfun,
|
||||
TLSClientConfig: &tls.Config{InsecureSkipVerify: true},
|
||||
},
|
||||
Timeout: 5 * time.Second,
|
||||
}
|
||||
}
|
||||
|
||||
func (slf *HttpClientModule) SetTimeOut(value time.Duration) {
|
||||
slf.client.Timeout = value
|
||||
}
|
||||
|
||||
func (slf *HttpClientModule) SyncRequest(method string, url string, body []byte, header http.Header) SyncHttpRespone {
|
||||
ret := SyncHttpRespone{
|
||||
resp: make(chan HttpRespone, 1),
|
||||
|
||||
Reference in New Issue
Block a user