diff --git a/contrib/registry/nacos/watcher.go b/contrib/registry/nacos/watcher.go index 6fd59b378a2..7f1dc84663a 100644 --- a/contrib/registry/nacos/watcher.go +++ b/contrib/registry/nacos/watcher.go @@ -41,10 +41,17 @@ func newWatcher(ctx context.Context, cli naming_client.INamingClient, serviceNam Clusters: clusters, GroupName: groupName, SubscribeCallback: func(services []model.SubscribeService, err error) { - w.watchChan <- struct{}{} + select { + case w.watchChan <- struct{}{}: + default: + } }, } e := w.cli.Subscribe(w.subscribeParam) + select { + case w.watchChan <- struct{}{}: + default: + } return w, e }