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:
parent
b3594c25d3
commit
407250bf6c
@ -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…
Reference in New Issue
Block a user