From d236d094add04f36cbab6040c196d1d36249a108 Mon Sep 17 00:00:00 2001 From: Patryk Kalinowski Date: Fri, 18 Aug 2023 16:18:14 +0300 Subject: [PATCH] ethmonitor: info log if fetchNextBlock times out (#104) --- ethmonitor/ethmonitor.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ethmonitor/ethmonitor.go b/ethmonitor/ethmonitor.go index a0c037a4..77d9b30f 100644 --- a/ethmonitor/ethmonitor.go +++ b/ethmonitor/ethmonitor.go @@ -281,7 +281,11 @@ func (m *Monitor) monitor() error { // .. nextBlock, miss, err := m.fetchNextBlock(ctx) if err != nil { - m.log.Warnf("ethmonitor: fetchNextBlock error reported '%v', for blockNum:%d, retrying..", err, m.nextBlockNumber.Uint64()) + if errors.Is(err, context.DeadlineExceeded) { + m.log.Infof("ethmonitor: fetchNextBlock timed out: '%v', for blockNum:%d, retrying..", err, m.nextBlockNumber.Uint64()) + } else { + m.log.Warnf("ethmonitor: fetchNextBlock error reported '%v', for blockNum:%d, retrying..", err, m.nextBlockNumber.Uint64()) + } // pause, then retry time.Sleep(m.options.PollingInterval)