lmdb/badger: print id on value read error.
This commit is contained in:
@@ -78,9 +78,10 @@ func (b BadgerBackend) QueryEvents(ctx context.Context, filter nostr.Filter) (ch
|
|||||||
idx, q.prefix, key, err)
|
idx, q.prefix, key, err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
err = item.Value(func(val []byte) error {
|
item.Value(func(val []byte) error {
|
||||||
evt := &nostr.Event{}
|
evt := &nostr.Event{}
|
||||||
if err := nostr_binary.Unmarshal(val, evt); err != nil {
|
if err := nostr_binary.Unmarshal(val, evt); err != nil {
|
||||||
|
log.Printf("badger: value read error (id %x): %s\n", val[0:32], err)
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -91,9 +92,6 @@ func (b BadgerBackend) QueryEvents(ctx context.Context, filter nostr.Filter) (ch
|
|||||||
|
|
||||||
return nil
|
return nil
|
||||||
})
|
})
|
||||||
if err != nil {
|
|
||||||
log.Printf("badger: value read error: %s\n", err)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}(i, q)
|
}(i, q)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -94,7 +94,7 @@ func (b *LMDBBackend) QueryEvents(ctx context.Context, filter nostr.Filter) (cha
|
|||||||
|
|
||||||
evt := &nostr.Event{}
|
evt := &nostr.Event{}
|
||||||
if err := nostr_binary.Unmarshal(val, evt); err != nil {
|
if err := nostr_binary.Unmarshal(val, evt); err != nil {
|
||||||
log.Printf("lmdb: value read error: %s\n", err)
|
log.Printf("lmdb: value read error (id %x): %s\n", val[0:32], err)
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user