Skip to content

Commit

Permalink
Add keepalive max age
Browse files Browse the repository at this point in the history
  • Loading branch information
angelini committed Jul 31, 2024
1 parent a2bea01 commit d718dba
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,10 @@ func NewServer(ctx context.Context, dbConn *DbPoolConnector, cert *tls.Certifica
grpc.MaxRecvMsgSize(MAX_MESSAGE_SIZE),
grpc.MaxSendMsgSize(MAX_MESSAGE_SIZE),
grpc.Creds(creds),
grpc.KeepaliveParams(keepalive.ServerParameters{
MaxConnectionAge: 120 * time.Second,
MaxConnectionAgeGrace: 45 * time.Second,
}),
grpc.KeepaliveEnforcementPolicy(keepalive.EnforcementPolicy{
MinTime: 2 * time.Second,
PermitWithoutStream: true,
Expand Down

0 comments on commit d718dba

Please sign in to comment.