We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a2d559b commit a585e7dCopy full SHA for a585e7d
cmd/apiserver/main.go
@@ -31,6 +31,7 @@ import (
31
kolidepb "github.com/nais/kolide-event-handler/pkg/pb"
32
"github.com/sirupsen/logrus"
33
"google.golang.org/grpc"
34
+ "google.golang.org/grpc/keepalive"
35
)
36
37
const (
@@ -257,7 +258,11 @@ func run(log *logrus.Entry, cfg config.Config) error {
257
258
sessions,
259
260
- grpcServer := grpc.NewServer()
261
+ opts := []grpc.ServerOption{
262
+ grpc.KeepaliveEnforcementPolicy(keepalive.EnforcementPolicy{MinTime: 9 * time.Second}),
263
+ }
264
+
265
+ grpcServer := grpc.NewServer(opts...)
266
pb.RegisterAPIServerServer(grpcServer, grpcHandler)
267
268
grpcListener, err := net.Listen("tcp", cfg.GRPCBindAddress)
0 commit comments