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

feat: Implement the logic of the NACOS service in the Discovery module #604

Closed
wants to merge 18 commits into from
Closed

Conversation

xyombo
Copy link
Contributor

@xyombo xyombo commented Aug 21, 2023

What this PR does:
#577

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

Does this PR introduce a user-facing change?:


pkg/discovery/nacos_test.go Show resolved Hide resolved
return &NacosRegistryService{client, nacosConfig}
}

func ParseNacosServerConfig(config NacosConfig) ([]constant.ServerConfig, error) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

建议改为小写非导出的内部函数

@codecov-commenter
Copy link

codecov-commenter commented Aug 23, 2023

Codecov Report

Attention: 17 lines in your changes are missing coverage. Please review.

Comparison is base (4330268) 37.28% compared to head (3c16adf) 37.41%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #604      +/-   ##
==========================================
+ Coverage   37.28%   37.41%   +0.12%     
==========================================
  Files         175      175              
  Lines       11666    11712      +46     
==========================================
+ Hits         4350     4382      +32     
- Misses       6952     6964      +12     
- Partials      364      366       +2     
Files Coverage Δ
pkg/discovery/init.go 63.63% <0.00%> (-3.04%) ⬇️
pkg/discovery/nacos.go 62.74% <65.95%> (+62.74%) ⬆️

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

"github.com/seata/seata-go/pkg/util/log"
)

type NacosRegistryService struct {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

可以在nacos.go内部维护一份缓存,并监听nacos server的节点变化,更新本地缓存。

"github.com/nacos-group/nacos-sdk-go/v2/model"
"github.com/seata/seata-go/pkg/discovery/mock"
"github.com/stretchr/testify/assert"
"reflect"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

format

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

ServiceName: s.nacosServerConfig.Application,
})
if err != nil {
log.Fatalf("select all nacos service instance error")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems don't need Fatalf level

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

@xyombo xyombo closed this Oct 14, 2023
@xyombo xyombo reopened this Oct 16, 2023
@xyombo
Copy link
Contributor Author

xyombo commented Oct 16, 2023

@iSuperCoder @georgehao

please review my newest updated codes again that are changes in response to some review comments. below are details of what are commit work for :

in this commit i change the log level Fatalf to Warn

in this commit i format codes as expect

Below comments are no comments match

The main purpose of this commit is to resolve the merge conflict.

The main purpose of this commit is to fix for missing update go.mod and go.sum files

If there is anything that I have done wrong, please do not hesitate to provide guidance. Thx :)

@xyombo xyombo requested a review from iSuperCoder October 16, 2023 05:13
@luky116 luky116 closed this Feb 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants