just sleep if we get error 502
This commit is contained in:
parent
ae0fc63030
commit
e1cff81b4c
|
@ -41,6 +41,11 @@ func gethonks(server, token string, wanted int) HonkSet {
|
||||||
}
|
}
|
||||||
defer resp.Body.Close()
|
defer resp.Body.Close()
|
||||||
if resp.StatusCode != 200 {
|
if resp.StatusCode != 200 {
|
||||||
|
if resp.StatusCode == 502 {
|
||||||
|
log.Printf("server error 502...")
|
||||||
|
time.Sleep(5 * time.Minute)
|
||||||
|
return HonkSet{}
|
||||||
|
}
|
||||||
answer, _ := ioutil.ReadAll(resp.Body)
|
answer, _ := ioutil.ReadAll(resp.Body)
|
||||||
log.Fatalf("status: %d: %s", resp.StatusCode, answer)
|
log.Fatalf("status: %d: %s", resp.StatusCode, answer)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue