mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
client: define DefaultRequestTimeout
This commit is contained in:
@@ -26,7 +26,8 @@ import (
|
||||
)
|
||||
|
||||
var (
|
||||
ErrTimeout = context.DeadlineExceeded
|
||||
ErrTimeout = context.DeadlineExceeded
|
||||
DefaultRequestTimeout = 5 * time.Second
|
||||
)
|
||||
|
||||
// transport mimics http.Transport to provide an interface which can be
|
||||
|
||||
@@ -105,7 +105,7 @@ func New(durl string, id uint64, config string) (Discoverer, error) {
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
c, err := client.NewDiscoveryKeysAPI(&http.Transport{Proxy: pf}, u.String(), time.Second*5)
|
||||
c, err := client.NewDiscoveryKeysAPI(&http.Transport{Proxy: pf}, u.String(), client.DefaultRequestTimeout)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user