Skip to content

Commit

Permalink
fix:callback function execution start context being canceled
Browse files Browse the repository at this point in the history
  • Loading branch information
万玉勤 committed Oct 16, 2024
1 parent ac4e3d6 commit 2ba2c51
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion producer/producer.go
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,7 @@ func (p *defaultProducer) sendAsync(ctx context.Context, msg *primitive.Message,

ctx, cancel := context.WithTimeout(ctx, p.options.SendMsgTimeout)
err := p.client.InvokeAsync(ctx, addr, p.buildSendRequest(mq, msg), func(command *remote.RemotingCommand, err error) {
cancel()
defer cancel()
if err != nil {
h(ctx, nil, err)
return
Expand Down

0 comments on commit 2ba2c51

Please sign in to comment.