From cc34c3e35d1d63a8c150c548d5616bdd8b89bd89 Mon Sep 17 00:00:00 2001 From: Dawid Rusnak Date: Fri, 25 Oct 2024 15:56:36 +0200 Subject: [PATCH] chore: make const --- pkg/controlplane/server.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pkg/controlplane/server.go b/pkg/controlplane/server.go index 38c0b17f48..8589571a22 100644 --- a/pkg/controlplane/server.go +++ b/pkg/controlplane/server.go @@ -29,6 +29,7 @@ const ( KeepAliveTime = 10 * time.Second KeepAliveTimeout = 5 * time.Second HealthCheckInterval = 60 * time.Second + SendPingInterval = HealthCheckInterval / 2 ) type Server struct { @@ -105,7 +106,7 @@ func (s *Server) GetTestWorkflowNotificationsStream(srv cloud.TestKubeCloudAPI_G defer cancel() g, _ := errgroup.WithContext(ctx) - ticker := time.NewTicker(30 * time.Second) + ticker := time.NewTicker(SendPingInterval) defer ticker.Stop() g.Go(func() error { @@ -161,7 +162,7 @@ func (s *Server) GetLogsStream(srv cloud.TestKubeCloudAPI_GetLogsStreamServer) e defer cancel() g, _ := errgroup.WithContext(ctx) - ticker := time.NewTicker(30 * time.Second) + ticker := time.NewTicker(SendPingInterval) defer ticker.Stop() g.Go(func() error {