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