aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulio Capote <jcapote@gmail.com>2022-12-19 15:00:27 +0000
committerJulio Capote <jcapote@gmail.com>2022-12-19 15:00:27 +0000
commit3c992dda076fb3e5db0f4316bdbf1cbe1d2ed274 (patch)
treedaefd7b869b6c11b0056339db0d19a7a798e311d
parentbaf3d4cd12ac1dda157507f648ae1fb4fa95b58c (diff)
downloadcommunique-3c992dda076fb3e5db0f4316bdbf1cbe1d2ed274.tar.gz
dont prefetch key values
-rw-r--r--resources/outbox.go8
1 files changed, 6 insertions, 2 deletions
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() {