From 407250bf6ca45d2193c85f4a938240e5e2088e65 Mon Sep 17 00:00:00 2001 From: zwhyb <57396775+zwhyb@users.noreply.github.com> Date: Tue, 27 Jul 2021 15:52:24 +0800 Subject: [PATCH] create watcher overtime (#1263) --- transport/grpc/resolver/discovery/builder.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/transport/grpc/resolver/discovery/builder.go b/transport/grpc/resolver/discovery/builder.go index 03ab16ecd..5ccdf6ef7 100644 --- a/transport/grpc/resolver/discovery/builder.go +++ b/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()