diff --git a/registry/cache/cache.go b/registry/cache/cache.go index 33680ffbca..867ea079ae 100644 --- a/registry/cache/cache.go +++ b/registry/cache/cache.go @@ -161,11 +161,12 @@ func (c *cache) get(service string) ([]*registry.Service, error) { } // cache results + cp := util.Copy(services) c.Lock() - c.set(service, util.Copy(services)) + c.set(service, services) c.Unlock() - return services, nil + return cp, nil } // watch service if not watched