Skip to content

Commit

Permalink
fix: the var of span occurrence Unexpected.#571 (#572)
Browse files Browse the repository at this point in the history
  • Loading branch information
DenisYin66 committed Nov 21, 2022
1 parent 7f255f8 commit c472fd9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pkg/client/rocketmq/consumer.go
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,9 @@ func (cc *PushConsumer) RegisterSingleMessage(f func(context.Context, *primitive
err := f(ctx, msg)
if err != nil {
xlog.Jupiter().Error("consumer message", zap.Error(err), zap.String("field", cc.name), zap.Any("ext", msg))
span.RecordError(err)
if cc.EnableTrace && span != nil {
span.RecordError(err)
}
return consumer.ConsumeRetryLater, err
}
}
Expand Down

0 comments on commit c472fd9

Please sign in to comment.