mirror of
https://github.com/containous/traefik.git
synced 2025-03-19 18:50:12 +03:00
feat: timeout on check
This commit is contained in:
parent
a0b775a7c0
commit
4a8f032304
@ -86,7 +86,11 @@ func (hc *HealthCheck) execute() {
|
||||
}
|
||||
|
||||
func testHealth(serverURL *url.URL, checkURL string) bool {
|
||||
resp, err := http.Get(serverURL.String() + checkURL)
|
||||
timeout := time.Duration(5 * time.Second)
|
||||
client := http.Client{
|
||||
Timeout: timeout,
|
||||
}
|
||||
resp, err := client.Get(serverURL.String() + checkURL)
|
||||
if err != nil || resp.StatusCode != 200 {
|
||||
return false
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user