Skip to content

Commit

Permalink
electrumx: fix close metrics for conn pool (#243)
Browse files Browse the repository at this point in the history
  • Loading branch information
joshuasing authored Aug 30, 2024
1 parent a728d4c commit 6d68681
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion hemi/electrumx/conn_pool.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,10 @@ func (p *connPool) onClose(conn *clientConn) {
removed := len(p.pool) != l
p.poolMx.Unlock()

if p.metrics != nil && removed {
if p.metrics != nil {
if removed {
p.metrics.connsIdle.Dec()
}
p.metrics.connsClosed.Inc()
p.metrics.connsOpen.Dec()
}
Expand Down

0 comments on commit 6d68681

Please sign in to comment.