Skip to content

Commit

Permalink
Merge pull request #2329 from Jacob-bzx/main
Browse files Browse the repository at this point in the history
fix: avoid panic when Metadata.RefreshFrequency is 0
  • Loading branch information
dnwe committed Sep 15, 2022
2 parents 3083a9b + 04099ad commit 07f9abf
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions consumer_group.go
Expand Up @@ -572,6 +572,9 @@ func (c *consumerGroup) handleError(err error, topic string, partition int32) {
}

func (c *consumerGroup) loopCheckPartitionNumbers(topics []string, session *consumerGroupSession) {
if c.config.Metadata.RefreshFrequency == time.Duration(0) {
return
}
pause := time.NewTicker(c.config.Metadata.RefreshFrequency)
defer session.cancel()
defer pause.Stop()
Expand Down

0 comments on commit 07f9abf

Please sign in to comment.