1
0
mirror of https://github.com/go-micro/go-micro.git synced 2024-12-24 10:07:04 +02:00

fixing etcd stack in getToken (#2145)

when provide username and password, etcd will try to get auth token from server
if server is unavailble, etcd client will stack in
when dial timeout is set, it will return err instead of stack in
This commit is contained in:
Johnson C 2021-04-01 16:55:21 +08:00 committed by GitHub
parent 9b41d1bf08
commit bed53b605f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -56,6 +56,7 @@ func configure(e *etcdRegistry, opts ...registry.Option) error {
if e.options.Timeout == 0 {
e.options.Timeout = 5 * time.Second
}
config.DialTimeout = e.options.Timeout
if e.options.Secure || e.options.TLSConfig != nil {
tlsConfig := e.options.TLSConfig