mirror of
https://github.com/TeaOSLab/EdgeNode.git
synced 2025-11-08 19:40:25 +08:00
优化RPC客户端锁
This commit is contained in:
@@ -231,8 +231,8 @@ func (this *RPCClient) init() error {
|
|||||||
|
|
||||||
// 随机选择一个连接
|
// 随机选择一个连接
|
||||||
func (this *RPCClient) pickConn() *grpc.ClientConn {
|
func (this *RPCClient) pickConn() *grpc.ClientConn {
|
||||||
this.locker.RLock()
|
this.locker.Lock()
|
||||||
defer this.locker.RUnlock()
|
defer this.locker.Unlock()
|
||||||
|
|
||||||
// 检查连接状态
|
// 检查连接状态
|
||||||
if len(this.conns) > 0 {
|
if len(this.conns) > 0 {
|
||||||
|
|||||||
Reference in New Issue
Block a user