Skip to content

Commit d121dcc

Browse files
committed
fix(tx): do not return an error when deleted message is not found
Signed-off-by: Adphi <philippe.adrien.nousse@gmail.com>
1 parent 09482d0 commit d121dcc

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

internal/db/tx.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -649,19 +649,19 @@ func (tx *tx) delete(ctx context.Context, m proto.Message) error {
649649
if err != nil {
650650
return err
651651
}
652+
trace.SpanFromContext(ctx).SetAttributes(
653+
attribute.String("key", value),
654+
attribute.String("key_field", field),
655+
)
652656

653657
uid, ok, err := tx.uid(ctx, k, false)
654658
if err != nil {
655659
return err
656660
}
657661
if !ok {
658-
return badger.ErrKeyNotFound
662+
return nil
659663
}
660-
trace.SpanFromContext(ctx).SetAttributes(
661-
attribute.String("key", value),
662-
attribute.String("key_field", field),
663-
attribute.Int64("uid", int64(uid)),
664-
)
664+
trace.SpanFromContext(ctx).SetAttributes(attribute.Int64("uid", int64(uid)))
665665

666666
if err := ctx.Err(); err != nil {
667667
tx.close()

0 commit comments

Comments
 (0)