فهرست منبع

Merge pull request #1211 from ming-relax/master

Makes code style consistent in kafka client after refresh metadata
Vlad Gorodetsky 6 سال پیش
والد
کامیت
cbccf093cc
1فایلهای تغییر یافته به همراه2 افزوده شده و 1 حذف شده
  1. 2 1
      client.go

+ 2 - 1
client.go

@@ -288,7 +288,8 @@ func (client *client) Partitions(topic string) ([]int32, error) {
 		partitions = client.cachedPartitions(topic, allPartitions)
 	}
 
-	if partitions == nil {
+	// no partitions found after refresh metadata
+	if len(partitions) == 0 {
 		return nil, ErrUnknownTopicOrPartition
 	}