Skip to content

Commit

Permalink
Fixed leaky subscription when getting sequence history
Browse files Browse the repository at this point in the history
  • Loading branch information
manterfield committed Nov 23, 2023
1 parent 57b309a commit 3a8ee33
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions nats/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,9 @@ func (c *Client) FetchMessageBundle(ctx context.Context, newMsg *MsgMeta) (Messa
msgBundle := MessageBundle{}

msgCtx, err := cons.Messages()
if msgCtx != nil {
defer msgCtx.Stop()
}
if err != nil {
return nil, fmt.Errorf("Unable to read back messages: %w", err)
}
Expand Down

0 comments on commit 3a8ee33

Please sign in to comment.