fix the delete service issue in nacos registry (#553)

This commit is contained in:
澄潭
2023-09-27 09:30:39 +08:00
committed by GitHub
parent 4e392d1cf6
commit d8c34bb863
2 changed files with 2 additions and 2 deletions

View File

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

View File

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