-
Notifications
You must be signed in to change notification settings - Fork 929
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
Try update value if node already exists #2314
Conversation
@chickenlj please fix the ci failure. |
@@ -344,8 +344,7 @@ func (l *ZkEventListener) listenDirEvent(conf *common.URL, zkRootPath string, li | |||
failTimes = MaxFailTimes | |||
} | |||
|
|||
err = perrors.Cause(err) | |||
if !strings.Contains(err.Error(), "node does not exist") { // ignore if node not exist | |||
if !perrors.Is(err, zk.ErrNoNode) { // ignore if node not exist |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@chickenlj 这个地方我有异议,这个地方不需要修改啊,原来的没啥问题。你修改后,会不会遗漏一些case就不晓得了。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
实际上,上面的字符串关键字 node does not exist
也是从 ErrNoNode
定义中取的,因此两者能检查的范围应该是一致的。
ErrNoNode = errors.New("zk: node does not exist")
perrors.Is 文档说是会嵌套往下检查,理论上与应该没啥问题。
Kudos, SonarCloud Quality Gate passed! |
Codecov Report
@@ Coverage Diff @@
## main #2314 +/- ##
=======================================
Coverage 44.19% 44.19%
=======================================
Files 294 294
Lines 17867 17867
=======================================
Hits 7897 7897
Misses 9127 9127
Partials 843 843 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
No description provided.