the number of unreliable servers in the federation is too damn high!
This commit is contained in:
parent
1d97b24c82
commit
fc4f13d9e0
|
@ -137,7 +137,12 @@ func GetJunk(url string) (map[string]interface{}, error) {
|
||||||
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 {
|
if err != nil {
|
||||||
return nil, err
|
log.Printf("first get failed: %s", err)
|
||||||
|
resp, err = client.Do(req)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
log.Printf("retry succeeded!")
|
||||||
}
|
}
|
||||||
if resp.StatusCode != 200 {
|
if resp.StatusCode != 200 {
|
||||||
resp.Body.Close()
|
resp.Body.Close()
|
||||||
|
|
Loading…
Reference in New Issue