diff --git a/registry/memory/cache.go b/registry/memory/cache.go index b8ed2a373..9df0e31dd 100644 --- a/registry/memory/cache.go +++ b/registry/memory/cache.go @@ -122,8 +122,8 @@ func (s *store) DeleteServiceEntryWrapper(service string) { if data, exist := s.sew[service]; exist { s.toBeDeleted = append(s.toBeDeleted, data) + s.deferedDelete[service] = struct{}{} } - s.deferedDelete[service] = struct{}{} } // should only be called when reconcile is done diff --git a/registry/nacos/v2/watcher.go b/registry/nacos/v2/watcher.go index 158cdb49a..5ce3ef00f 100644 --- a/registry/nacos/v2/watcher.go +++ b/registry/nacos/v2/watcher.go @@ -484,7 +484,7 @@ func (w *watcher) Stop() { } // clean the cache - suffix := strings.Join([]string{s[0], w.NacosNamespace, w.Type}, common.DotSeparator) + suffix := strings.Join([]string{s[0], w.NacosNamespace, "nacos"}, common.DotSeparator) suffix = strings.ReplaceAll(suffix, common.Underscore, common.Hyphen) host := strings.Join([]string{s[1], suffix}, common.DotSeparator) w.cache.DeleteServiceEntryWrapper(host)