Skip to content

Commit

Permalink
Only log first bad multihash error to prevent log flooding.
Browse files Browse the repository at this point in the history
  • Loading branch information
gammazero authored and masih committed Jun 7, 2022
1 parent 1b0fbb4 commit 7f16c33
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion internal/ingest/linksystem.go
Original file line number Diff line number Diff line change
Expand Up @@ -316,8 +316,11 @@ func (ing *Ingester) indexContentBlock(adCid cid.Cid, ad schema.Advertisement, p
var count, badMultihashCount int
for _, entry := range nchunk.Entries {
if _, err = multihash.Decode(entry); err != nil {
// Only log first error to prevent log flooding.
if badMultihashCount == 0 {
log.Warnw("Ignoring bad multihash", "err", err)
}
badMultihashCount++
log.Warnw("Ignoring bad multihash", "err", err)
continue
}

Expand Down

0 comments on commit 7f16c33

Please sign in to comment.