Skip to content

Commit 57cb436

Browse files
committed
Code review
1 parent 08a740e commit 57cb436

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

build/Dockerfile.nginx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# syntax=docker/dockerfile:1.12
2+
# TODO(sberman): the commented out lines are for when we use the published agent release
23
# FROM scratch AS nginx-files
34

45
# # the following links can be replaced with local files if needed, i.e. ADD --chown=101:1001 <local_file> <container_file>

internal/mode/static/nginx/agent/grpc.go

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@ import (
1212
"sigs.k8s.io/controller-runtime/pkg/manager"
1313
)
1414

15+
const (
16+
keepAliveTime = 1 * time.Minute
17+
keepAliveTimeout = 15 * time.Second
18+
)
19+
1520
// GRPCServer is a gRPC server for communicating with the nginx agent.
1621
type GRPCServer struct {
1722
Logger logr.Logger
@@ -32,8 +37,8 @@ func (g *GRPCServer) Start(ctx context.Context) error {
3237
server := grpc.NewServer(
3338
grpc.KeepaliveParams(
3439
keepalive.ServerParameters{
35-
Time: 1 * time.Minute,
36-
Timeout: 15 * time.Second,
40+
Time: keepAliveTime,
41+
Timeout: keepAliveTimeout,
3742
},
3843
),
3944
)

0 commit comments

Comments
 (0)