mirror of
https://github.com/TeamPiped/instances-api.git
synced 2024-08-14 23:57:19 +00:00
Set a timeout for requests.
This commit is contained in:
parent
20e5350736
commit
9e4c9e9d8c
1 changed files with 5 additions and 1 deletions
6
main.go
6
main.go
|
@ -44,8 +44,12 @@ type FrontendConfig struct {
|
|||
S3Enabled bool `json:"s3Enabled"`
|
||||
}
|
||||
|
||||
var client = http.Client{
|
||||
Timeout: 10 * time.Second,
|
||||
}
|
||||
|
||||
func testUrl(url string) (*http.Response, error) {
|
||||
resp, err := http.Get(url)
|
||||
resp, err := client.Get(url)
|
||||
if err != nil {
|
||||
return resp, err
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue