From 9661a8d839c78e4a3ef80c58b4f002653df4dece Mon Sep 17 00:00:00 2001 From: Dongri Jin Date: Thu, 26 Oct 2023 11:54:31 +0900 Subject: [PATCH] Change the scope of the log Signed-off-by: Dongri Jin --- core/naive-strategy.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/core/naive-strategy.go b/core/naive-strategy.go index 43578767..39637495 100644 --- a/core/naive-strategy.go +++ b/core/naive-strategy.go @@ -131,8 +131,6 @@ func (st *NaiveStrategy) UnrelayedPackets(src, dst *ProvableChain, sh SyncHeader return nil, err } - defer logger.TimeTrack(now, "UnrelayedPackets", "num_src", len(srcPackets), "num_dst", len(dstPackets)) - if err := st.updateBacklogMetrics(context.TODO(), src, dst, srcPackets, dstPackets); err != nil { return nil, err } @@ -173,6 +171,8 @@ func (st *NaiveStrategy) UnrelayedPackets(src, dst *ProvableChain, sh SyncHeader } } + defer logger.TimeTrack(now, "UnrelayedPackets", "num_src", len(srcPackets), "num_dst", len(dstPackets)) + return &RelayPackets{ Src: srcPackets, Dst: dstPackets, @@ -344,8 +344,6 @@ func (st *NaiveStrategy) UnrelayedAcknowledgements(src, dst *ProvableChain, sh S return nil, err } - defer logger.TimeTrack(now, "UnrelayedAcknowledgements", "num_src", len(srcAcks), "num_dst", len(dstAcks)) - // If includeRelayedButUnfinalized is true, this function should return packets of which AcknowledgePacket is not finalized yet. // In this case, filtering packets by QueryUnreceivedAcknowledgements is not needed because QueryUnfinalizedRelayAcknowledgements // has already returned packets that completely match this condition. @@ -386,6 +384,8 @@ func (st *NaiveStrategy) UnrelayedAcknowledgements(src, dst *ProvableChain, sh S } } + defer logger.TimeTrack(now, "UnrelayedAcknowledgements", "num_src", len(srcAcks), "num_dst", len(dstAcks)) + return &RelayPackets{ Src: srcAcks, Dst: dstAcks,