Skip to content

Commit

Permalink
chore: reformat the code (#54)
Browse files Browse the repository at this point in the history
  • Loading branch information
chenquan authored Jun 6, 2024
1 parent 4389ad5 commit 7b89f09
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions picker.go
Original file line number Diff line number Diff line change
Expand Up @@ -211,9 +211,8 @@ func (p *p2cPicker) choose(c1, c2 *followerConn) *followerConn {
func (p *p2cPicker) logStats() {
p.lock.Lock()
defer p.lock.Unlock()
conns := p.getConns()
stats := make([]string, 0, len(conns))
for _, conn := range conns {
stats := make([]string, 0, len(p.connsMap))
for _, conn := range p.connsMap {
stats = append(stats, fmt.Sprintf("db: %s, load: %d, reqs: %d",
conn.name, conn.load(), atomic.SwapInt64(&conn.requests, 0)))
}
Expand Down

0 comments on commit 7b89f09

Please sign in to comment.