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

Loading…
Cancel
Save