mirror of
https://github.com/imjasonh/staticmaps
synced 2026-07-16 20:42:04 +00:00
Add backoff http.RoundTripper that that handles exponential backoff
This commit is contained in:
parent
41f9b8b763
commit
f9c0e3df19
3 changed files with 85 additions and 1 deletions
4
maps.go
4
maps.go
|
|
@ -23,7 +23,9 @@ func NewWorkClient(clientID, signature string) Client {
|
|||
}
|
||||
|
||||
func (c Client) do(url string) (*http.Response, error) {
|
||||
cl := &http.Client{Transport: c.Transport}
|
||||
cl := &http.Client{Transport: &backoff{
|
||||
Transport: &c.Transport,
|
||||
}}
|
||||
req, err := http.NewRequest("GET", url, nil)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue