Kaynağa Gözat

Restrict client metadata update more

If Metadata.Full is set to false, and no topics have ever been
requested, the first background refresh would load them all because go's
varags don't distinguish between nothing and an explicitly splatted
empty array.

Just break instead.
Evan Huus 9 yıl önce
ebeveyn
işleme
eda03deb5f
1 değiştirilmiş dosya ile 3 ekleme ve 0 silme
  1. 3 0
      client.go

+ 3 - 0
client.go

@@ -612,6 +612,9 @@ func (client *client) backgroundMetadataUpdater() {
 				if specificTopics, err := client.Topics(); err != nil {
 				if specificTopics, err := client.Topics(); err != nil {
 					Logger.Println("Client background metadata topic load:", err)
 					Logger.Println("Client background metadata topic load:", err)
 					break
 					break
+				} else if len(specificTopics) == 0 {
+					Logger.Println("Client background metadata update: no specific topics to update")
+					break
 				} else {
 				} else {
 					topics = specificTopics
 					topics = specificTopics
 				}
 				}