Skip to content

Commit

Permalink
Merge pull request #30 from Kuri-su/feature-kurisu-optimization-consu…
Browse files Browse the repository at this point in the history
…l-watcher-220705

feat: optimization consul watcher
  • Loading branch information
xpunch authored Jul 24, 2022
2 parents e3081cf + c0c846a commit 00666a4
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
5 changes: 4 additions & 1 deletion v2/registry/consul/watcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,10 @@ func newConsulWatcher(cr *consulRegistry, opts ...registry.WatchOption) (registr
services: make(map[string][]*registry.Service),
}

wp, err := watch.Parse(map[string]interface{}{"type": "services"})
wp, err := watch.Parse(map[string]interface{}{
"service": wo.Service,
"type": "service",
})
if err != nil {
return nil, err
}
Expand Down
5 changes: 4 additions & 1 deletion v3/registry/consul/watcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,10 @@ func newConsulWatcher(cr *consulRegistry, opts ...registry.WatchOption) (registr
services: make(map[string][]*registry.Service),
}

wp, err := watch.Parse(map[string]interface{}{"type": "services"})
wp, err := watch.Parse(map[string]interface{}{
"service": wo.Service,
"type": "service",
})
if err != nil {
return nil, err
}
Expand Down
5 changes: 4 additions & 1 deletion v4/registry/consul/watcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,10 @@ func newConsulWatcher(cr *consulRegistry, opts ...registry.WatchOption) (registr
services: make(map[string][]*registry.Service),
}

wp, err := watch.Parse(map[string]interface{}{"type": "services"})
wp, err := watch.Parse(map[string]interface{}{
"service": wo.Service,
"type": "service",
})
if err != nil {
return nil, err
}
Expand Down

0 comments on commit 00666a4

Please sign in to comment.