mirror of
https://github.com/go-kratos/kratos.git
synced 2025-01-26 03:52:12 +02:00
feat(resolver/discovery): expose create watcher timeout error (#3392)
This commit is contained in:
parent
084c8b4167
commit
642790484c
@ -14,6 +14,8 @@ import (
|
||||
|
||||
const name = "discovery"
|
||||
|
||||
var ErrWatcherCreateTimeout = errors.New("discovery create watcher overtime")
|
||||
|
||||
// Option is builder option.
|
||||
type Option func(o *builder)
|
||||
|
||||
@ -96,7 +98,7 @@ func (b *builder) Build(target resolver.Target, cc resolver.ClientConn, _ resolv
|
||||
case <-done:
|
||||
err = watchRes.err
|
||||
case <-time.After(b.timeout):
|
||||
err = errors.New("discovery create watcher overtime")
|
||||
err = ErrWatcherCreateTimeout
|
||||
}
|
||||
if err != nil {
|
||||
cancel()
|
||||
|
Loading…
x
Reference in New Issue
Block a user