From d964a51b76b38b792bfd672fc393417bd093f348 Mon Sep 17 00:00:00 2001 From: whyrusleeping Date: Thu, 2 Nov 2023 10:24:02 -0700 Subject: [PATCH] ensure 'blocks' field is set in tooBig events --- events/dbpersist.go | 1 + indexer/indexer.go | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/events/dbpersist.go b/events/dbpersist.go index 77a027607..18413256c 100644 --- a/events/dbpersist.go +++ b/events/dbpersist.go @@ -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 } diff --git a/indexer/indexer.go b/indexer/indexer.go index cdfcd1918..c1bbbdc07 100644 --- a/indexer/indexer.go +++ b/indexer/indexer.go @@ -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 }