From b2e937d807560fe80feaad5cada1583cd8ba2a7f Mon Sep 17 00:00:00 2001 From: Vistaar Juneja Date: Fri, 3 Feb 2023 13:16:51 +0000 Subject: [PATCH] (fix): Increase health check timeout to 10 seconds (#118) --- cli/client/http.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cli/client/http.go b/cli/client/http.go index 2d7564df..b6265879 100644 --- a/cli/client/http.go +++ b/cli/client/http.go @@ -21,6 +21,10 @@ import ( "github.com/sirupsen/logrus" ) +var ( + healthCheckTimeout = 10 * time.Second +) + // Error represents a json-encoded API error. type Error struct { Message string @@ -182,7 +186,7 @@ func (c *HTTPClient) RetryHealth(ctx context.Context, timeout time.Duration) (*a } func (c *HTTPClient) healthCheck(ctx context.Context) (*api.HealthResponse, error) { - hctx, cancel := context.WithTimeout(ctx, time.Second) + hctx, cancel := context.WithTimeout(ctx, healthCheckTimeout) defer cancel() return c.Health(hctx)