-
-
Notifications
You must be signed in to change notification settings - Fork 4k
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:config groutine(watch) leak #1327
Conversation
Codecov Report
@@ Coverage Diff @@
## main #1327 +/- ##
==========================================
- Coverage 60.49% 60.30% -0.20%
==========================================
Files 59 59
Lines 2739 2751 +12
==========================================
+ Hits 1657 1659 +2
- Misses 937 946 +9
- Partials 145 146 +1
Continue to review full report at Codecov.
|
config/config.go
Outdated
@@ -65,6 +66,10 @@ func New(opts ...Option) Config { | |||
func (c *config) watch(w Watcher) { | |||
for { | |||
kvs, err := w.Next() | |||
if err == context.Canceled { |
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.
是不是应该用标准库的errors.Is 判断比较好?
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.
ok
* fix:config goroutine(watch) Leak
Description (what this PR does / why we need it):
Which issue(s) this PR fixes:
fixes #
Other special notes for reviewer:
code :
kratos/config/config.go
Line 111 in 55cf830