Set a timeout for requests.
This commit is contained in:
parent
20e5350736
commit
9e4c9e9d8c
6
main.go
6
main.go
|
@ -44,8 +44,12 @@ type FrontendConfig struct {
|
||||||
S3Enabled bool `json:"s3Enabled"`
|
S3Enabled bool `json:"s3Enabled"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var client = http.Client{
|
||||||
|
Timeout: 10 * time.Second,
|
||||||
|
}
|
||||||
|
|
||||||
func testUrl(url string) (*http.Response, error) {
|
func testUrl(url string) (*http.Response, error) {
|
||||||
resp, err := http.Get(url)
|
resp, err := client.Get(url)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return resp, err
|
return resp, err
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue