If GET /index fails, retry in 500ms

This commit is contained in:
Elara 2020-12-05 21:04:07 -08:00
parent 1f60dd56de
commit 1c6e8244d9

View File

@ -125,7 +125,7 @@ func RecvFiles(senderAddr string) {
indexGetFailed := true
for indexGetFailed {
response, err = http.Get(serverAddr + "/index")
if err != nil { log.Fatal().Err(err).Msg("Error getting index") } else {indexGetFailed = false}
if err == nil { indexGetFailed = false }
time.Sleep(500*time.Millisecond)
}
}