Skip to content

Commit

Permalink
ensure 'blocks' field is set in tooBig events
Browse files Browse the repository at this point in the history
  • Loading branch information
whyrusleeping committed Nov 2, 2023
1 parent 13ded56 commit d964a51
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions events/dbpersist.go
Original file line number Diff line number Diff line change
Expand Up @@ -549,6 +549,7 @@ func (p *DbPersistence) hydrateCommit(ctx context.Context, rer *RepoEventRecord)

if len(cs) > carstore.MaxSliceLength {
out.TooBig = true
out.Blocks = []byte{}
} else {
out.Blocks = cs
}
Expand Down
2 changes: 1 addition & 1 deletion indexer/indexer.go
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ func (ix *Indexer) HandleRepoEvent(ctx context.Context, evt *repomgr.RepoEvent)
toobig := false
slice := evt.RepoSlice
if len(slice) > MaxEventSliceLength || len(outops) > MaxOpsSliceLength {
slice = nil
slice = []byte{}
outops = nil
toobig = true
}
Expand Down

0 comments on commit d964a51

Please sign in to comment.