Skip to content

Commit

Permalink
move logs
Browse files Browse the repository at this point in the history
  • Loading branch information
manav2401 authored and Victor Castell committed May 10, 2022
1 parent e4e5d4a commit be01489
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions consensus/bor/rest.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,14 +107,14 @@ func (h *HeimdallClient) FetchWithRetry(rawPath string, rawQuery string) (*Respo
if err == nil && res != nil {
return res, nil
}
log.Info("Retrying again in 5 seconds to fetch data from Heimdall", "path", u.Path, "attempt", attempt)
attempt++

// create a new ticker for retrying the request
ticker := time.NewTicker(5 * time.Second)
defer ticker.Stop()

for {
log.Info("Retrying again in 5 seconds to fetch data from Heimdall", "path", u.Path, "attempt", attempt)
attempt++
select {
case <-h.closeCh:
log.Debug("Shutdown detected, terminating request")
Expand All @@ -124,8 +124,6 @@ func (h *HeimdallClient) FetchWithRetry(rawPath string, rawQuery string) (*Respo
if err == nil && res != nil {
return res, nil
}
log.Info("Retrying again in 5 seconds to fetch data from Heimdall", "path", u.Path, "attempt", attempt)
attempt++
}
}
}
Expand Down

0 comments on commit be01489

Please sign in to comment.