Skip to content

Commit

Permalink
Merge pull request onflow#6514 from onflow/leo/remove-duplicated-debu…
Browse files Browse the repository at this point in the history
…g-logs

[Requester] Remove duplicated debug logs
  • Loading branch information
zhangchiqing authored Oct 8, 2024
2 parents 3602aeb + e33501b commit efd21c1
Showing 1 changed file with 8 additions and 13 deletions.
21 changes: 8 additions & 13 deletions engine/common/requester/engine.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
}
Expand Down

0 comments on commit efd21c1

Please sign in to comment.