If GET /index fails, retry in 500ms
This commit is contained in:
parent
1f60dd56de
commit
1c6e8244d9
2
files.go
2
files.go
@ -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)
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user