Compare commits
1 Commits
e0f18fb837
...
fix_accoun
| Author | SHA1 | Date | |
|---|---|---|---|
| 11b4f6fdf2 |
@@ -61,19 +61,10 @@ func GetClient(s interface{}) (*RpcClient, error) {
|
||||
mutex.Lock()
|
||||
xClient, ok = mClient.Load(key)
|
||||
if !ok {
|
||||
var d client.ServiceDiscovery
|
||||
var err error
|
||||
if basePath == "ik3cloud" {
|
||||
d, err = client.NewPeer2PeerDiscovery("tcp@localhost:8081", "")
|
||||
d, err := consulClient.NewConsulDiscovery(basePath, servicePath, config.RpcConfig.RegistryServer, nil)
|
||||
if err != nil {
|
||||
return nil, errors.New("系统异常")
|
||||
}
|
||||
} else {
|
||||
d, err = consulClient.NewConsulDiscovery(basePath, servicePath, config.RpcConfig.RegistryServer, nil)
|
||||
if err != nil {
|
||||
return nil, errors.New("系统异常")
|
||||
}
|
||||
}
|
||||
option := client.DefaultOption
|
||||
option.Retries = 3
|
||||
option.GenBreaker = func() client.Breaker {
|
||||
|
||||
Reference in New Issue
Block a user