mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-01-19 02:48:24 +00:00
grpc add PermitWithoutStream to client and server options
This commit is contained in:
parent
f69a1694e7
commit
37a3628b2e
|
@ -30,6 +30,7 @@ func NewGrpcServer(opts ...grpc.ServerOption) *grpc.Server {
|
||||||
Timeout: 20 * time.Second, // ping timeout
|
Timeout: 20 * time.Second, // ping timeout
|
||||||
}), grpc.KeepaliveEnforcementPolicy(keepalive.EnforcementPolicy{
|
}), grpc.KeepaliveEnforcementPolicy(keepalive.EnforcementPolicy{
|
||||||
MinTime: 60 * time.Second, // min time a client should wait before sending a ping
|
MinTime: 60 * time.Second, // min time a client should wait before sending a ping
|
||||||
|
PermitWithoutStream: true,
|
||||||
}))
|
}))
|
||||||
for _, opt := range opts {
|
for _, opt := range opts {
|
||||||
if opt != nil {
|
if opt != nil {
|
||||||
|
@ -48,6 +49,7 @@ func GrpcDial(ctx context.Context, address string, opts ...grpc.DialOption) (*gr
|
||||||
grpc.WithKeepaliveParams(keepalive.ClientParameters{
|
grpc.WithKeepaliveParams(keepalive.ClientParameters{
|
||||||
Time: 30 * time.Second, // client ping server if no activity for this long
|
Time: 30 * time.Second, // client ping server if no activity for this long
|
||||||
Timeout: 20 * time.Second,
|
Timeout: 20 * time.Second,
|
||||||
|
PermitWithoutStream: true,
|
||||||
}))
|
}))
|
||||||
for _, opt := range opts {
|
for _, opt := range opts {
|
||||||
if opt != nil {
|
if opt != nil {
|
||||||
|
|
Loading…
Reference in a new issue