From 04099ad5754141c3ea57a1127cb3e8d5a34ad316 Mon Sep 17 00:00:00 2001 From: Jacob-bzx Date: Wed, 7 Sep 2022 23:45:34 +0800 Subject: [PATCH] fix: avoid panic when Metadata.RefreshFrequency is 0 --- consumer_group.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/consumer_group.go b/consumer_group.go index b20edd978..7d755eae4 100644 --- a/consumer_group.go +++ b/consumer_group.go @@ -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()