Skip to content

Commit

Permalink
Allow for more frequent keepalives (#387)
Browse files Browse the repository at this point in the history
* Allow for more frequent keepalives

* Remove server parameter
  • Loading branch information
neekolas authored May 2, 2024
1 parent 827b3f2 commit 9b84f9e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/api/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import (
"github.com/xmtp/xmtp-node-go/pkg/tracing"
"google.golang.org/grpc/health"
healthgrpc "google.golang.org/grpc/health/grpc_health_v1"
"google.golang.org/grpc/keepalive"

"go.uber.org/zap"
"google.golang.org/grpc"
Expand Down Expand Up @@ -141,6 +142,9 @@ func (s *Server) startGRPC() error {
grpc.Creds(insecure.NewCredentials()),
grpc.UnaryInterceptor(middleware.ChainUnaryServer(unary...)),
grpc.StreamInterceptor(middleware.ChainStreamServer(stream...)),
grpc.KeepaliveEnforcementPolicy(keepalive.EnforcementPolicy{
MinTime: 15 * time.Second,
}),
grpc.MaxRecvMsgSize(s.Config.Options.MaxMsgSize),
}
grpcServer := grpc.NewServer(options...)
Expand Down

0 comments on commit 9b84f9e

Please sign in to comment.