Alanxtl commented on code in PR #3482:
URL: https://github.com/apache/dubbo-go/pull/3482#discussion_r3567658407
##########
registry/polaris/core.go:
##########
@@ -36,11 +36,15 @@ import (
type item func(remoting.EventType, []model.Instance)
type PolarisServiceWatcher struct {
- consumer api.ConsumerAPI
- subscribeParam *api.WatchServiceRequest
- lock *sync.RWMutex
- subscribers []item
- execOnce *sync.Once
+ consumer api.ConsumerAPI
+ subscribeParam *api.WatchServiceRequest
+ lock *sync.RWMutex
+ subscribers []item
+ execOnce *sync.Once
+ initialSnapshotLock sync.Mutex
Review Comment:
名字统一一下 这个变量在nacos中叫
initialSubscribeInstances sync.Map
##########
registry/polaris/registry.go:
##########
@@ -139,15 +143,7 @@ func (pr *polarisRegistry) Subscribe(url *common.URL,
notifyListener registry.No
for {
serviceName := url.Interface()
- watcher, err := pr.createPolarisWatcher(serviceName)
- if err != nil {
- logger.Warnf("[Registry][Polaris] getwatcher() =
err=%v", perrors.WithStack(err))
- <-timer.C
- timer.Reset(time.Duration(RegistryConnDelay) *
time.Second)
- continue
- }
Review Comment:
为什么这里不需要handle err了
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]