Skip to content

Commit

Permalink
Pause heartbeat detection during reconnection
Browse files Browse the repository at this point in the history
  • Loading branch information
withinboredom authored May 17, 2024
1 parent 833574b commit 34dc2a1
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions jetstream/pull.go
Original file line number Diff line number Diff line change
Expand Up @@ -596,6 +596,12 @@ func (s *pullSubscription) Next() (Msg, error) {
if errors.Is(err, errConnected) {
if !isConnected {
isConnected = true

if hbMonitor != nil {
// we are not going to get a heartbeat while reconnecting
hbMonitor.Stop()
}

// try fetching consumer info several times to make sure consumer is available after reconnect
backoffOpts := backoffOpts{
attempts: 10,
Expand Down

0 comments on commit 34dc2a1

Please sign in to comment.