Da-Hong commented on issue #1322:
URL: https://github.com/apache/dubbo-go/issues/1322#issuecomment-882202227


   What I fix, but not perfect.
   ```go
   // DataChange changes all listeners' event
   func (l *CacheListener) DataChange(event remoting.Event) bool {
        if event.Content == "" {
                //meanings new node
                return true
        }
        key := l.pathToKey(event.Path)
        if key != "" {
                count := 1
                for {
                        if listeners, ok := l.keyListeners.Load(key); ok {
                                for listener := range 
listeners.(map[config_center.ConfigurationListener]struct{}) {
                                        
listener.Process(&config_center.ConfigChangeEvent{Key: key, Value: 
event.Content, ConfigType: event.Action})
                                }
                                return true
                        }
                        if count > 3 {
                                break
                        }
                        time.Sleep(time.Second * 1)
                        count = count + 1
                }
        }
        return false
   }
   ```


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