Set timeout for requests
This commit is contained in:
parent
fc504daaa6
commit
fb0cbdc0bd
|
@ -6,6 +6,7 @@ import (
|
|||
"net/http"
|
||||
"fmt"
|
||||
"net/url"
|
||||
"time"
|
||||
)
|
||||
|
||||
type OvrStatApi struct {
|
||||
|
@ -20,7 +21,7 @@ func New(apiUrl string) *OvrStatApi {
|
|||
return nil
|
||||
}
|
||||
|
||||
return &OvrStatApi{Client: &http.Client{}, URL: u}
|
||||
return &OvrStatApi{Client: &http.Client{Timeout: 10 * time.Second}, URL: u}
|
||||
}
|
||||
|
||||
func (s *OvrStatApi) FetchProfile(platform, region, battletag string) (*OwApiResponse, error) {
|
||||
|
|
Loading…
Reference in New Issue