Commit 6d4bbe0a authored by Vladimir Barsukov's avatar Vladimir Barsukov
Browse files

zgo_debug

parent ffafeb48
//go:build dev
//go:build zgo_debug
package zdb
......
......@@ -204,7 +204,10 @@ func (d *Pool) sync() *Conn {
}
if d.Balance == BalanceRoundRobin {
return d.SrvSync[d.slavesIter.Add(1)%int64(len(d.SrvSync))]
conn := d.SrvSync[d.slavesIter.Add(1)%int64(len(d.SrvSync))]
logConnStat(conn)
return conn
}
return d.least(d.SrvSync)
......@@ -223,7 +226,10 @@ func (d *Pool) async() *Conn {
}
if d.Balance == BalanceRoundRobin {
return d.SrvAsync[d.slavesAsyncIter.Add(1)%int64(len(d.SrvAsync))]
conn := d.SrvAsync[d.slavesAsyncIter.Add(1)%int64(len(d.SrvAsync))]
logConnStat(conn)
return conn
}
return d.least(d.SrvAsync)
......
//go:build !dev
//go:build !zgo_debug
package zdb
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment