From 7b24350c7dbb80031f30f5503cda0724320c6ce2 Mon Sep 17 00:00:00 2001 From: lifeiyi <736926938@qq.com> Date: Thu, 17 Sep 2020 17:18:52 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8DHTTPClient=E8=B6=85=E6=97=B6?= =?UTF-8?q?=E4=B8=8D=E5=8F=8D=E5=9B=9E=E9=97=AE=E9=A2=98=EF=BC=8C=E5=B9=B6?= =?UTF-8?q?=E6=8F=90=E4=BE=9B=E8=AE=BE=E7=BD=AE=E8=B6=85=E6=97=B6=E6=97=B6?= =?UTF-8?q?=E9=97=B4=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sysmodule/httpclientmodule/httpclientpoolmodule.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sysmodule/httpclientmodule/httpclientpoolmodule.go b/sysmodule/httpclientmodule/httpclientpoolmodule.go index 09fe7a2..76834ba 100644 --- a/sysmodule/httpclientmodule/httpclientpoolmodule.go +++ b/sysmodule/httpclientmodule/httpclientpoolmodule.go @@ -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),