Update registry util semantics
This commit is contained in:
parent
0a0bb33007
commit
926aba3801
@ -97,7 +97,7 @@ func (c *cache) get(service string) ([]*registry.Service, error) {
|
|||||||
// got services && within ttl so return cache
|
// got services && within ttl so return cache
|
||||||
if c.isValid(services, ttl) {
|
if c.isValid(services, ttl) {
|
||||||
// make a copy
|
// make a copy
|
||||||
cp := registry.CopyServices(services)
|
cp := registry.Copy(services)
|
||||||
// unlock the read
|
// unlock the read
|
||||||
c.RUnlock()
|
c.RUnlock()
|
||||||
// return servics
|
// return servics
|
||||||
@ -114,7 +114,7 @@ func (c *cache) get(service string) ([]*registry.Service, error) {
|
|||||||
|
|
||||||
// cache results
|
// cache results
|
||||||
c.Lock()
|
c.Lock()
|
||||||
c.set(service, registry.CopyServices(services))
|
c.set(service, registry.Copy(services))
|
||||||
c.Unlock()
|
c.Unlock()
|
||||||
|
|
||||||
return services, nil
|
return services, nil
|
||||||
|
Loading…
Reference in New Issue
Block a user