mirror of
https://github.com/duanhf2012/origin.git
synced 2026-05-17 14:27:30 +08:00
优化origin默认模式的服务发现
This commit is contained in:
@@ -10,7 +10,8 @@ import (
|
||||
//跨结点连接的Client
|
||||
type NatsClient struct {
|
||||
localNodeId string
|
||||
|
||||
notifyEventFun NotifyEventFun
|
||||
|
||||
natsConn *nats.Conn
|
||||
client *Client
|
||||
}
|
||||
@@ -85,5 +86,5 @@ func (rc *NatsClient) WriteMsg (nodeId string,args ...[]byte) error{
|
||||
}
|
||||
|
||||
func (rc *NatsClient) IsConnected() bool{
|
||||
return rc.natsConn.Status() == nats.CONNECTED
|
||||
return rc.natsConn!=nil && rc.natsConn.Status() == nats.CONNECTED
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user