Rename peer cluster cache
This commit is contained in:
parent
948af0a12b
commit
3d7db4248f
|
@ -319,7 +319,7 @@ type Core struct {
|
||||||
// Lock for the cluster leader values
|
// Lock for the cluster leader values
|
||||||
clusterLeaderParamsLock sync.RWMutex
|
clusterLeaderParamsLock sync.RWMutex
|
||||||
// Info on cluster members
|
// Info on cluster members
|
||||||
peerClusterAddrsCache *cache.Cache
|
clusterPeerClusterAddrsCache *cache.Cache
|
||||||
// The grpc Server that handles server RPC calls
|
// The grpc Server that handles server RPC calls
|
||||||
rpcServer *grpc.Server
|
rpcServer *grpc.Server
|
||||||
// The context for the client
|
// The context for the client
|
||||||
|
@ -447,7 +447,7 @@ func NewCore(conf *CoreConfig) (*Core, error) {
|
||||||
clusterName: conf.ClusterName,
|
clusterName: conf.ClusterName,
|
||||||
clusterListenerShutdownCh: make(chan struct{}),
|
clusterListenerShutdownCh: make(chan struct{}),
|
||||||
clusterListenerShutdownSuccessCh: make(chan struct{}),
|
clusterListenerShutdownSuccessCh: make(chan struct{}),
|
||||||
peerClusterAddrsCache: cache.New(3*heartbeatInterval, time.Second),
|
clusterPeerClusterAddrsCache: cache.New(3*heartbeatInterval, time.Second),
|
||||||
enableMlock: !conf.DisableMlock,
|
enableMlock: !conf.DisableMlock,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -364,7 +364,7 @@ func (s *forwardedRequestRPCServer) ForwardRequest(ctx context.Context, freq *fo
|
||||||
|
|
||||||
func (s *forwardedRequestRPCServer) Echo(ctx context.Context, in *EchoRequest) (*EchoReply, error) {
|
func (s *forwardedRequestRPCServer) Echo(ctx context.Context, in *EchoRequest) (*EchoReply, error) {
|
||||||
if in.ClusterAddr != "" {
|
if in.ClusterAddr != "" {
|
||||||
s.core.peerClusterAddrsCache.Set(in.ClusterAddr, nil, 0)
|
s.core.clusterPeerClusterAddrsCache.Set(in.ClusterAddr, nil, 0)
|
||||||
}
|
}
|
||||||
return &EchoReply{
|
return &EchoReply{
|
||||||
Message: "pong",
|
Message: "pong",
|
||||||
|
|
Loading…
Reference in New Issue