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:nacos service provider does not require subscribe #1056

Merged
merged 1 commit into from
Feb 23, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
fix:nacos service provider does not require subscribe
  • Loading branch information
kezhan committed Feb 16, 2021
commit e6dd10891ff47e6d9113a06c20031c3bdb56fcce
5 changes: 5 additions & 0 deletions registry/nacos/registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,11 @@ func (nr *nacosRegistry) subscribe(conf *common.URL) (registry.Listener, error)

// subscribe from registry
func (nr *nacosRegistry) Subscribe(url *common.URL, notifyListener registry.NotifyListener) error {
role, _ := strconv.Atoi(nr.URL.GetParam(constant.ROLE_KEY, ""))
if role != common.CONSUMER {
return nil
}

for {
if !nr.IsAvailable() {
logger.Warnf("event listener game over.")
Expand Down