From 3c992dda076fb3e5db0f4316bdbf1cbe1d2ed274 Mon Sep 17 00:00:00 2001 From: Julio Capote Date: Mon, 19 Dec 2022 10:00:27 -0500 Subject: dont prefetch key values --- resources/outbox.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'resources/outbox.go') diff --git a/resources/outbox.go b/resources/outbox.go index ed87dd8..4dd022b 100644 --- a/resources/outbox.go +++ b/resources/outbox.go @@ -33,7 +33,9 @@ func RenderOutboxPage(name, domain string, db *badger.DB) (map[string]interface{ itemsProp := streams.NewActivityStreamsOrderedItemsProperty() err = db.View(func(txn *badger.Txn) error { - it := txn.NewIterator(badger.DefaultIteratorOptions) + opts := badger.DefaultIteratorOptions + opts.PrefetchValues = false + it := txn.NewIterator(opts) defer it.Close() prefix := []byte("outbox:sample") // TODO for it.Seek(prefix); it.ValidForPrefix(prefix); it.Next() { @@ -86,7 +88,9 @@ func RenderOutbox(name, domain string, db *badger.DB) (map[string]interface{}, e var i int err = db.View(func(txn *badger.Txn) error { - it := txn.NewIterator(badger.DefaultIteratorOptions) + opts := badger.DefaultIteratorOptions + opts.PrefetchValues = false + it := txn.NewIterator(opts) defer it.Close() prefix := []byte("outbox:sample") // TODO for it.Seek(prefix); it.ValidForPrefix(prefix); it.Next() { -- cgit v1.2.3