chore_: fix defer logs

This commit is contained in:
Igor Sirotin 2024-07-25 16:30:28 +01:00
parent c5c291ac5a
commit b36ddda6ed
2 changed files with 12 additions and 1 deletions

View File

@ -3445,8 +3445,9 @@ func (m *Messenger) SyncVerificationRequest(ctx context.Context, vr *verificatio
// MessengerResponse to the client
func (m *Messenger) RetrieveAll() (*MessengerResponse, error) {
m.logger.Debug("RetrieveAll start")
defer m.logger.Debug("RetrieveAll end")
chatWithMessages, err := m.transport.RetrieveRawAll()
m.logger.Debug("RetrieveAll end", zap.Any("chatWithMessages", chatWithMessages))
if err != nil {
return nil, err
}
@ -3900,7 +3901,13 @@ func (m *Messenger) handleImportedMessages(messagesToHandle map[transport.Filter
return nil
}
var handleRetrievedMessagesCounter = atomic.NewInt32(0)
func (m *Messenger) handleRetrievedMessages(chatWithMessages map[transport.Filter][]*types.Message, storeWakuMessages bool, fromArchive bool) (*MessengerResponse, error) {
counter := handleRetrievedMessagesCounter.Inc()
m.logger.Debug("handleRetrievedMessages start", zap.Int32("counter", counter))
defer m.logger.Debug("handleRetrievedMessages end", zap.Int32("counter", counter))
m.handleMessagesMutex.Lock()
defer m.handleMessagesMutex.Unlock()

View File

@ -17,6 +17,7 @@ import (
"golang.org/x/exp/maps"
"github.com/ethereum/go-ethereum/common"
"github.com/status-im/status-go/connection"
"github.com/status-im/status-go/eth-node/crypto"
"github.com/status-im/status-go/eth-node/types"
@ -223,6 +224,9 @@ func (t *Transport) GetStats() types.StatsSummary {
}
func (t *Transport) RetrieveRawAll() (map[Filter][]*types.Message, error) {
t.logger.Debug("RetrieveRawAll start")
defer t.logger.Debug("RetrieveRawAll end")
result := make(map[Filter][]*types.Message)
logger := t.logger.With(zap.String("site", "retrieveRawAll"))