Add default timeout to pkg/plugins/client
Signed-off-by: Chun Chen <ramichen@tencent.com> Upstream-commit: 0699b00d26a60f4a8447572b34c4aad1ce73d2e1 Component: engine
This commit is contained in:
@ -16,7 +16,8 @@ import (
|
||||
)
|
||||
|
||||
const (
|
||||
defaultTimeOut = 30
|
||||
defaultTimeOut = 30
|
||||
defaultHTTPTimeOut = 32 * time.Second
|
||||
)
|
||||
|
||||
// NewClient creates a new plugin client (http).
|
||||
@ -53,6 +54,7 @@ func NewClient(addr string, tlsConfig *tlsconfig.Options) (*Client, error) {
|
||||
func NewClientWithTransport(tr transport.Transport) *Client {
|
||||
return &Client{
|
||||
http: &http.Client{
|
||||
Timeout: defaultHTTPTimeOut,
|
||||
Transport: tr,
|
||||
},
|
||||
requestFactory: tr,
|
||||
|
||||
Reference in New Issue
Block a user