Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix service discovery subscription #2480

Merged
merged 13 commits into from
Nov 5, 2023
Prev Previous commit
use pointer
  • Loading branch information
chickenlj committed Nov 4, 2023
commit cbad419e11e8b3b5a693adb5f7326dc277ed07af
4 changes: 2 additions & 2 deletions cluster/directory/base/directory.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ type Directory struct {
}

// NewDirectory Create BaseDirectory with URL
func NewDirectory(url *common.URL) Directory {
return Directory{
func NewDirectory(url *common.URL) *Directory {
return &Directory{
url: url,
destroyed: atomic.NewBool(false),
routerChain: &chain.RouterChain{},
Expand Down
2 changes: 1 addition & 1 deletion cluster/directory/static/directory.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import (
)

type directory struct {
base.Directory
*base.Directory
invokers []protocol.Invoker
}

Expand Down
8 changes: 4 additions & 4 deletions registry/directory/directory.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ func init() {
// RegistryDirectory implementation of Directory:
// Invoker list returned from this Directory's list method have been filtered by Routers
type RegistryDirectory struct {
base.Directory
*base.Directory
cacheInvokers []protocol.Invoker
invokersLock sync.RWMutex
serviceType string
Expand Down Expand Up @@ -569,8 +569,8 @@ func (l *consumerConfigurationListener) Process(event *config_center.ConfigChang
// ServiceDiscoveryRegistryDirectory implementation of Directory:
// Invoker list returned from this Directory's list method have been filtered by Routers
type ServiceDiscoveryRegistryDirectory struct {
base.Directory
RegistryDirectory
*base.Directory
*RegistryDirectory
}

// NewServiceDiscoveryRegistryDirectory will create a new ServiceDiscoveryRegistryDirectory
Expand All @@ -579,7 +579,7 @@ func NewServiceDiscoveryRegistryDirectory(url *common.URL, registry registry.Reg
registryDirectory, _ := dic.(*RegistryDirectory)
return &ServiceDiscoveryRegistryDirectory{
Directory: registryDirectory.Directory,
RegistryDirectory: *registryDirectory,
RegistryDirectory: registryDirectory,
}, err
}

Expand Down
Loading