From 32158bcef203ff4719f7a82eb3171f232a8b4181 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8C=85=E5=AD=90?= Date: Fri, 17 Dec 2021 11:08:16 +0800 Subject: [PATCH] fix(nacos): call unsubscribe when watching is stopped (#1697) --- contrib/registry/nacos/watcher.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/contrib/registry/nacos/watcher.go b/contrib/registry/nacos/watcher.go index eac90b12f..c5d652fc6 100644 --- a/contrib/registry/nacos/watcher.go +++ b/contrib/registry/nacos/watcher.go @@ -78,6 +78,9 @@ func (w *watcher) Next() ([]*registry.ServiceInstance, error) { func (w *watcher) Stop() error { w.cancel() - // close - return nil + return w.cli.Unsubscribe(&vo.SubscribeParam{ + ServiceName: w.serviceName, + GroupName: w.groupName, + Clusters: w.clusters, + }) }