increment peer per topic count on graft messages (#5212)

* increment peer per topic count on graft messages
This commit is contained in:
João Oliveira 2024-02-08 02:00:49 +00:00 committed by GitHub
parent 853042746b
commit 675a231b45
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1380,7 +1380,11 @@ where
tracing::error!(peer_id = %peer_id, "Peer non-existent when handling graft"); tracing::error!(peer_id = %peer_id, "Peer non-existent when handling graft");
return; return;
}; };
connected_peer.topics.insert(topic.clone()); if connected_peer.topics.insert(topic.clone()) {
if let Some(m) = self.metrics.as_mut() {
m.inc_topic_peers(topic);
}
}
} }
// we don't GRAFT to/from explicit peers; complain loudly if this happens // we don't GRAFT to/from explicit peers; complain loudly if this happens