fix: fix contrib registry eureka watcher as *watcher (#2693)

feat/ci-bot
yonwoo9 2 years ago committed by GitHub
parent a672980a15
commit 665a72e67f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      contrib/registry/eureka/watcher.go
  2. 1
      contrib/registry/servicecomb/registry.go

@ -33,7 +33,7 @@ func newWatch(ctx context.Context, cli *API, serverName string) (*watcher, error
return w, e return w, e
} }
func (w watcher) Next() (services []*registry.ServiceInstance, err error) { func (w *watcher) Next() (services []*registry.ServiceInstance, err error) {
select { select {
case <-w.ctx.Done(): case <-w.ctx.Done():
return nil, w.ctx.Err() return nil, w.ctx.Err()

@ -147,6 +147,7 @@ func (r *Registry) Register(_ context.Context, svcIns *registry.ServiceInstance)
return err return err
} }
ticker := time.NewTicker(30 * time.Second) ticker := time.NewTicker(30 * time.Second)
defer ticker.Stop()
go func() { go func() {
for { for {
<-ticker.C <-ticker.C

Loading…
Cancel
Save