Skip to content

Commit 7b89f09

Browse files
authored
chore: reformat the code (#54)
1 parent 4389ad5 commit 7b89f09

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

picker.go

+2-3
Original file line numberDiff line numberDiff line change
@@ -211,9 +211,8 @@ func (p *p2cPicker) choose(c1, c2 *followerConn) *followerConn {
211211
func (p *p2cPicker) logStats() {
212212
p.lock.Lock()
213213
defer p.lock.Unlock()
214-
conns := p.getConns()
215-
stats := make([]string, 0, len(conns))
216-
for _, conn := range conns {
214+
stats := make([]string, 0, len(p.connsMap))
215+
for _, conn := range p.connsMap {
217216
stats = append(stats, fmt.Sprintf("db: %s, load: %d, reqs: %d",
218217
conn.name, conn.load(), atomic.SwapInt64(&conn.requests, 0)))
219218
}

0 commit comments

Comments
 (0)