Просмотр исходного кода

Don't let the caller pass in MaxWaitTime=0.

This mistake is far too easy to make, and rather harmful.
Burke Libbey 12 лет назад
Родитель
Сommit
8c2c1f53d4
1 измененных файлов с 1 добавлено и 1 удалено
  1. 1 1
      consumer.go

+ 1 - 1
consumer.go

@@ -89,7 +89,7 @@ func NewConsumer(client *Client, topic string, partition int32, group string, co
 		return nil, ConfigurationError("Invalid MaxMessageSize")
 	}
 
-	if config.MaxWaitTime < 0 {
+	if config.MaxWaitTime <= 0 {
 		return nil, ConfigurationError("Invalid MaxWaitTime")
 	} else if config.MaxWaitTime < 100 {
 		Logger.Println("ConsumerConfig.MaxWaitTime is very low, which can cause high CPU and network usage. See documentation for details.")