AlexStocks commented on code in PR #2859:
URL: https://github.com/apache/dubbo-go/pull/2859#discussion_r2072498611


##########
registry/nacos/registry.go:
##########
@@ -177,46 +177,67 @@ func (nr *nacosRegistry) Subscribe(url *common.URL, 
notifyListener registry.Noti
                return nil
        }
        serviceName := url.GetParam(constant.InterfaceKey, "")
-       var serviceNames []string
-       var err error
        if serviceName == constant.AnyValue {
-               serviceNames, err = nr.getAllSubscribeServiceNames(url)
-               if err != nil {
-                       return err
-               }
+               nr.subscribeAll(url, notifyListener)
+               go func() {
+                       // scheduled lookup for new service
+                       for {
+                               nr.subscribeAll(url, notifyListener)
+                               time.Sleep(LookupInterval)

Review Comment:
   这里 sleep 时间有点久,可以改成弹性:如果最近有拉倒新的,那就回归初始值 100ms,如果没有拉到,就翻倍,直至最大值 15s



-- 
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]

Reply via email to