diff --git a/pkg/index/corpus.go b/pkg/index/corpus.go index 4a86129b5..1a80a4690 100644 --- a/pkg/index/corpus.go +++ b/pkg/index/corpus.go @@ -130,6 +130,7 @@ func (crashStorage) Find(start, end string) sorted.Iterator { var corpusMergeFunc = map[string]func(c *Corpus, k, v []byte) error{ "have": nil, // redundant with "meta" + "recpn": nil, // unneeded. "meta": (*Corpus).mergeMetaRow, "signerkeyid": (*Corpus).mergeSignerKeyIdRow, "claim": (*Corpus).mergeClaimRow, @@ -686,3 +687,9 @@ func (c *Corpus) GetImageInfo(fileRef blob.Ref) (ii camtypes.ImageInfo, err erro } return } + +// SetVerboseCorpusLogging controls corpus setup verbosity. It's on by default +// but used to disable verbose logging in tests. +func SetVerboseCorpusLogging(v bool) { + logCorpusStats = v +} diff --git a/pkg/index/corpus_bench_test.go b/pkg/index/corpus_bench_test.go index 81a2bff67..578988d75 100644 --- a/pkg/index/corpus_bench_test.go +++ b/pkg/index/corpus_bench_test.go @@ -46,8 +46,8 @@ func BenchmarkCorpusFromStorage(b *testing.B) { id.SetAttribute(pn, "camliContent", fileRef.String()) } }) - defer index.ExpSetLogCorpusStats(true) - index.ExpSetLogCorpusStats(false) + defer index.SetVerboseCorpusLogging(true) + index.SetVerboseCorpusLogging(false) b.ResetTimer() diff --git a/pkg/index/export_test.go b/pkg/index/export_test.go index 754134b8c..1ddc21722 100644 --- a/pkg/index/export_test.go +++ b/pkg/index/export_test.go @@ -29,8 +29,6 @@ func ExpUnreverseTimeString(s string) string { return unreverseTimeString(s) } -func ExpSetLogCorpusStats(v bool) { logCorpusStats = v } - func ExpNewCorpus() *Corpus { return newCorpus() }