[#300] pool/cm: Remove unused mutex in 'statistics'

Signed-off-by: Alexander Chuprov <a.chuprov@yadro.com>
This commit is contained in:
Alexander Chuprov 2025-03-05 15:30:48 +03:00 committed by Evgenii Stratonikov
parent 56046935b0
commit 17177697b5

View file

@ -297,7 +297,6 @@ func (cm connectionManager) Statistic() Statistic {
stat := Statistic{}
for _, inner := range cm.innerPools {
nodes := make([]string, 0, len(inner.clients))
inner.lock.RLock()
for _, cl := range inner.clients {
if cl.isHealthy() {
nodes = append(nodes, cl.address())
@ -311,7 +310,6 @@ func (cm connectionManager) Statistic() Statistic {
stat.nodes = append(stat.nodes, node)
stat.overallErrors += node.overallErrors
}
inner.lock.RUnlock()
if len(stat.currentNodes) == 0 {
stat.currentNodes = nodes
}