move logs

This commit is contained in:
Manav Darji 2022-05-10 19:12:24 +05:30 committed by Victor Castell
parent e4e5d4a0c1
commit be01489883

View file

@ -107,14 +107,14 @@ func (h *HeimdallClient) FetchWithRetry(rawPath string, rawQuery string) (*Respo
if err == nil && res != nil { if err == nil && res != nil {
return 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 // create a new ticker for retrying the request
ticker := time.NewTicker(5 * time.Second) ticker := time.NewTicker(5 * time.Second)
defer ticker.Stop() defer ticker.Stop()
for { for {
log.Info("Retrying again in 5 seconds to fetch data from Heimdall", "path", u.Path, "attempt", attempt)
attempt++
select { select {
case <-h.closeCh: case <-h.closeCh:
log.Debug("Shutdown detected, terminating request") log.Debug("Shutdown detected, terminating request")
@ -124,8 +124,6 @@ func (h *HeimdallClient) FetchWithRetry(rawPath string, rawQuery string) (*Respo
if err == nil && res != nil { if err == nil && res != nil {
return res, nil return res, nil
} }
log.Info("Retrying again in 5 seconds to fetch data from Heimdall", "path", u.Path, "attempt", attempt)
attempt++
} }
} }
} }