create watcher overtime (#1263)

pull/1264/head
zwhyb 3 years ago committed by GitHub
parent b3594c25d3
commit 407250bf6c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      transport/grpc/resolver/discovery/builder.go

@ -2,6 +2,7 @@ package discovery
import (
"context"
"errors"
"time"
"github.com/go-kratos/kratos/v2/log"
@ -61,6 +62,7 @@ func (b *builder) Build(target resolver.Target, cc resolver.ClientConn, opts res
select {
case <-done:
case <-time.After(b.timeout):
err = errors.New("discovery create watcher overtime")
}
if err != nil {
cancel()

Loading…
Cancel
Save