Skip to content

Commit

Permalink
test: more logs
Browse files Browse the repository at this point in the history
  • Loading branch information
richard-ramos committed May 30, 2024
1 parent 1c39007 commit 2829fc9
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions cmd/storemsgcounter/execute.go
Original file line number Diff line number Diff line change
Expand Up @@ -285,10 +285,9 @@ func retrieveHistory(ctx context.Context, runId string, storenodes []peer.AddrIn
var result *store.Result
var err error

logger.Info("retrieving message history for topic", zap.Stringer("storenode", node), zap.Int64("from", startTime.UnixNano()), zap.Int64("to", endTime.UnixNano()))

queryLbl:
for i := 0; i < maxAttempts; i++ {
logger.Info("retrieving message history for topic", zap.Stringer("storenode", node), zap.Int64("from", startTime.UnixNano()), zap.Int64("to", endTime.UnixNano()), zap.Int("attempt", i))
result, err = wakuNode.Store().Query(ctx, store.FilterCriteria{
ContentFilter: protocol.NewContentFilter(topic),
TimeStart: proto.Int64(startTime.UnixNano()),
Expand Down Expand Up @@ -392,7 +391,8 @@ func verifyMessageExistence(ctx context.Context, runId string, peerID peer.ID, m

queryLbl:
for i := 0; i < maxAttempts; i++ {
result, err = wakuNode.Store().QueryByHash(ctx, messageHashes, store.IncludeData(false), store.WithPeer(peerInfo.ID))
logger.Info("querying by hash", zap.Stringer("storenode", peerID), zap.Stringers("hashes", messageHashes), zap.Int("attempt", i))
result, err = wakuNode.Store().QueryByHash(ctx, messageHashes, store.IncludeData(false), store.WithPeer(peerInfo.ID), store.WithPaging(false, 100))
if err != nil {
logger.Error("could not query storenode", zap.Stringer("storenode", peerInfo), zap.Error(err))
storeNodeFailure = true
Expand Down Expand Up @@ -436,6 +436,7 @@ queryLbl:

nextRetryLbl:
for i := 0; i < maxAttempts; i++ {
logger.Info("executing next while querying hashes", zap.Stringer("storenode", peerID), zap.Int("attempt", i))
err = result.Next(ctx)
if err != nil {
logger.Error("could not query storenode", zap.Stringer("storenode", peerInfo), zap.Error(err))
Expand Down

0 comments on commit 2829fc9

Please sign in to comment.