mirror of
https://github.com/duanhf2012/origin.git
synced 2026-02-04 06:54:45 +08:00
增加管道模式,即本地调用时,发生错误不断开连接状态
This commit is contained in:
@@ -7,6 +7,7 @@ import (
|
||||
"os"
|
||||
"sort"
|
||||
"strings"
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/duanhf2012/origin/rpc"
|
||||
@@ -33,6 +34,7 @@ type CCluster struct {
|
||||
writer net.Conn
|
||||
|
||||
LocalRpcClient *rpc.Client
|
||||
localRpcLocker sync.Mutex
|
||||
innerLocalServiceList map[string]bool
|
||||
}
|
||||
|
||||
@@ -186,7 +188,7 @@ func (slf *CCluster) ConnService() error {
|
||||
if slf.LocalRpcClient.IsClosed() {
|
||||
slf.ReSetLocalRpcClient()
|
||||
}
|
||||
time.Sleep(time.Second * 4)
|
||||
time.Sleep(time.Second * 2)
|
||||
}
|
||||
|
||||
return nil
|
||||
|
||||
Reference in New Issue
Block a user