diff --git a/registry/cache/cache.go b/registry/cache/cache.go index 35125918..378505f8 100644 --- a/registry/cache/cache.go +++ b/registry/cache/cache.go @@ -180,7 +180,7 @@ func (c *cache) get(service string) ([]*registry.Service, error) { // only kick it off if not running if !c.running { - go c.run() + go c.run(service) } c.Unlock() @@ -316,7 +316,7 @@ func (c *cache) update(res *registry.Result) { // run starts the cache watcher loop // it creates a new watcher if there's a problem -func (c *cache) run() { +func (c *cache) run(service string) { c.Lock() c.running = true c.Unlock() @@ -342,7 +342,7 @@ func (c *cache) run() { time.Sleep(time.Duration(j) * time.Millisecond) // create new watcher - w, err := c.Registry.Watch() + w, err := c.Registry.Watch(registry.WatchService(service)) if err != nil { if c.quit() { return