From e33501bc0a94e4306d7e788e6dd7dea822b1aa8d Mon Sep 17 00:00:00 2001 From: "Leo Zhang (zhangchiqing)" Date: Tue, 1 Oct 2024 13:53:51 -0700 Subject: [PATCH] remove duplicated debug logs --- engine/common/requester/engine.go | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/engine/common/requester/engine.go b/engine/common/requester/engine.go index b1e35bcb642..3a9031e3b5a 100644 --- a/engine/common/requester/engine.go +++ b/engine/common/requester/engine.go @@ -421,15 +421,6 @@ func (e *Engine) dispatchRequest() (bool, error) { } e.requests[req.Nonce] = req - if e.log.Debug().Enabled() { - e.log.Debug(). - Hex("provider", logging.ID(providerID)). - Uint64("nonce", req.Nonce). - Strs("entities", logging.IDs(entityIDs)). - TimeDiff("duration", time.Now(), requestStart). - Msg("entity request sent") - } - // NOTE: we forget about requests after the expiry of the shortest retry time // from the entities in the list; this means that we purge requests aggressively. // However, most requests should be responded to on the first attempt and clearing @@ -443,11 +434,15 @@ func (e *Engine) dispatchRequest() (bool, error) { delete(e.requests, req.Nonce) }() + if e.log.Debug().Enabled() { + e.log.Debug(). + Hex("provider", logging.ID(providerID)). + Uint64("nonce", req.Nonce). + Strs("entities", logging.IDs(entityIDs)). + TimeDiff("duration", time.Now(), requestStart). + Msg("entity request sent") + } e.metrics.MessageSent(e.channel.String(), metrics.MessageEntityRequest) - e.log.Debug(). - Uint64("nonce", req.Nonce). - Strs("entity_ids", flow.IdentifierList(req.EntityIDs).Strings()). - Msg("entity request sent") return true, nil }