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

refactor: remove providers and add prefix when use polaris #2274

Merged
merged 5 commits into from
May 11, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
fix:注册服务信息不带前缀
  • Loading branch information
chuntaojun committed Apr 7, 2023
commit 1682d4a30f01c4412b2e8cae63af0b0b09576082
3 changes: 3 additions & 0 deletions registry/polaris/registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,9 @@ type polarisRegistry struct {

// Register will register the service @url to its polaris registry center.
func (pr *polarisRegistry) Register(url *common.URL) error {
if getCategory(url) != "providers" {
return nil
}

serviceName := getServiceName(url)
request := createRegisterParam(url, serviceName)
Expand Down
2 changes: 0 additions & 2 deletions registry/polaris/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,6 @@ func getCategory(url *common.URL) string {
// just copy from dubbo-go for nacos
func getServiceName(url *common.URL) string {
var buffer bytes.Buffer

buffer.Write([]byte(getCategory(url)))
appendParam(&buffer, url, constant.InterfaceKey)
return buffer.String()
}
Expand Down