mirror of
https://github.com/TeaOSLab/EdgeNode.git
synced 2025-11-03 23:20:25 +08:00
优化RPC连接
This commit is contained in:
@@ -43,6 +43,10 @@ function build() {
|
|||||||
echo "building ..."
|
echo "building ..."
|
||||||
env GOOS=${OS} GOARCH=${ARCH} go build -o $DIST/bin/${NAME} -ldflags="-s -w" $ROOT/../cmd/edge-node/main.go
|
env GOOS=${OS} GOARCH=${ARCH} go build -o $DIST/bin/${NAME} -ldflags="-s -w" $ROOT/../cmd/edge-node/main.go
|
||||||
|
|
||||||
|
# delete hidden files
|
||||||
|
find $DIST -name ".DS_Store" -delete
|
||||||
|
find $DIST -name ".gitignore" -delete
|
||||||
|
|
||||||
echo "zip files"
|
echo "zip files"
|
||||||
cd "${DIST}/../" || exit
|
cd "${DIST}/../" || exit
|
||||||
if [ -f "${ZIP}" ]; then
|
if [ -f "${ZIP}" ]; then
|
||||||
|
|||||||
@@ -190,6 +190,11 @@ func (this *RPCClient) pickConn() *grpc.ClientConn {
|
|||||||
if len(availableConns) > 0 {
|
if len(availableConns) > 0 {
|
||||||
return availableConns[rands.Int(0, len(availableConns)-1)]
|
return availableConns[rands.Int(0, len(availableConns)-1)]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 关闭
|
||||||
|
for _, conn := range this.conns {
|
||||||
|
_ = conn.Close()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 重新初始化
|
// 重新初始化
|
||||||
|
|||||||
Reference in New Issue
Block a user