From be014898833624df17ef4f6c0eee572f7e91b8c5 Mon Sep 17 00:00:00 2001 From: Manav Darji Date: Tue, 10 May 2022 19:12:24 +0530 Subject: [PATCH] move logs --- consensus/bor/rest.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/consensus/bor/rest.go b/consensus/bor/rest.go index d548b03a6d..3ef531de18 100644 --- a/consensus/bor/rest.go +++ b/consensus/bor/rest.go @@ -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") @@ -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++ } } }