nsqio/nsq

nsqd: statistics aren't recorded when client publishes to multiple topics

オープン

#1,492 opened on 2024/07/05

 (1 件のコメント) (0 件のリアクション) (0 人の担当者)Go (2,898 件のフォーク)batch import
bughelp wanted

Repository metrics

Stars
 (25,788 個のスター)
PR merge metrics
 (30d に merged PR はありません)

説明

When a client sends messages to multiple topics, the statistics information can only output the results of one topic for a single client. After reviewing the code, I found that the problem lies in the break statement on line 305 of the client_v2.go file. Can you explain why this break statement is added?

for topic, count := range c.pubCounts {
	if len(topicName) > 0 && topic != topicName {
		continue
	}
	pubCounts = append(pubCounts, PubCount{
		Topic: topic,
		Count: count,
	})
	break   **//  What does this break statement do?**
}

コントリビューターガイド