use a timeout in the HTTP client used for consul sd (#3303)

pull/3330/head
Callum Styan 2017-10-20 08:56:30 -07:00 committed by Brian Brazil
parent 55a1311f6a
commit 45f9f3c539
1 changed files with 4 additions and 1 deletions

View File

@ -114,7 +114,10 @@ func NewDiscovery(conf *config.ConsulSDConfig, logger log.Logger) (*Discovery, e
conntrack.DialWithName("consul_sd"),
),
}
wrapper := &http.Client{Transport: transport}
wrapper := &http.Client{
Transport: transport,
Timeout: 30 * time.Second,
}
clientConf := &consul.Config{
Address: conf.Server,