1
0
mirror of https://github.com/go-kratos/kratos.git synced 2025-01-05 22:53:41 +02:00

create watcher overtime (#1263)

This commit is contained in:
zwhyb 2021-07-27 15:52:24 +08:00 committed by GitHub
parent b3594c25d3
commit 407250bf6c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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()