mirror of
https://github.com/zeromicro/go-zero.git
synced 2025-01-23 09:00:20 +08:00
fix(zrpc): remove default keepalive params for NewClientWithTarget (#3208)
This commit is contained in:
parent
8a043d2443
commit
8ad0668612
@ -11,8 +11,6 @@ import (
|
|||||||
"google.golang.org/grpc/keepalive"
|
"google.golang.org/grpc/keepalive"
|
||||||
)
|
)
|
||||||
|
|
||||||
const defaultClientKeepaliveTime = 20 * time.Second
|
|
||||||
|
|
||||||
var (
|
var (
|
||||||
// WithDialOption is an alias of internal.WithDialOption.
|
// WithDialOption is an alias of internal.WithDialOption.
|
||||||
WithDialOption = internal.WithDialOption
|
WithDialOption = internal.WithDialOption
|
||||||
@ -95,12 +93,6 @@ func NewClientWithTarget(target string, opts ...ClientOption) (Client, error) {
|
|||||||
Timeout: true,
|
Timeout: true,
|
||||||
}
|
}
|
||||||
|
|
||||||
opts = append([]ClientOption{
|
|
||||||
WithDialOption(grpc.WithKeepaliveParams(keepalive.ClientParameters{
|
|
||||||
Time: defaultClientKeepaliveTime,
|
|
||||||
})),
|
|
||||||
}, opts...)
|
|
||||||
|
|
||||||
return internal.NewClient(target, middlewares, opts...)
|
return internal.NewClient(target, middlewares, opts...)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user