Update registry util semantics

This commit is contained in:
Asim Aslam
2019-07-04 11:36:49 +01:00
parent 59a0e727e4
commit a412486c39
5 changed files with 71 additions and 68 deletions

View File

@@ -97,7 +97,7 @@ func (c *cache) get(service string) ([]*registry.Service, error) {
// got services && within ttl so return cache
if c.isValid(services, ttl) {
// make a copy
cp := registry.CopyServices(services)
cp := registry.Copy(services)
// unlock the read
c.RUnlock()
// return servics
@@ -114,7 +114,7 @@ func (c *cache) get(service string) ([]*registry.Service, error) {
// cache results
c.Lock()
c.set(service, registry.CopyServices(services))
c.set(service, registry.Copy(services))
c.Unlock()
return services, nil