the number of unreliable servers in the federation is too damn high!
This commit is contained in:
parent
1d97b24c82
commit
fc4f13d9e0
|
@ -136,9 +136,14 @@ func GetJunk(url string) (map[string]interface{}, error) {
|
||||||
req.Header.Set("Accept-Encoding", "gzip")
|
req.Header.Set("Accept-Encoding", "gzip")
|
||||||
req.Header.Set("User-Agent", "honksnonk/5.0")
|
req.Header.Set("User-Agent", "honksnonk/5.0")
|
||||||
resp, err := client.Do(req)
|
resp, err := client.Do(req)
|
||||||
|
if err != nil {
|
||||||
|
log.Printf("first get failed: %s", err)
|
||||||
|
resp, err = client.Do(req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
log.Printf("retry succeeded!")
|
||||||
|
}
|
||||||
if resp.StatusCode != 200 {
|
if resp.StatusCode != 200 {
|
||||||
resp.Body.Close()
|
resp.Body.Close()
|
||||||
return nil, fmt.Errorf("http get status: %d", resp.StatusCode)
|
return nil, fmt.Errorf("http get status: %d", resp.StatusCode)
|
||||||
|
|
Loading…
Reference in New Issue