1
0
Fork 0
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:
Jason Hall 2014-10-09 13:24:52 -04:00
parent 41f9b8b763
commit f9c0e3df19
3 changed files with 85 additions and 1 deletions

View file

@ -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