diff --git a/lib/consul/consul_discovery.go b/lib/consul/consul_discovery.go index ce71204..7df5efa 100644 --- a/lib/consul/consul_discovery.go +++ b/lib/consul/consul_discovery.go @@ -203,7 +203,7 @@ func (d *ConsulDiscovery) watch() { continue } for _, p := range ps { - if !strings.HasPrefix(p.Key, prefix) { // avoid prefix issue of consul List + if path.Dir(p.Key) != d.basePath { continue } k := strings.TrimPrefix(p.Key, prefix)