Skip to content

Commit

Permalink
(fix): Increase health check timeout to 10 seconds (#118)
Browse files Browse the repository at this point in the history
  • Loading branch information
vistaarjuneja authored Feb 3, 2023
1 parent 2c5ea84 commit b2e937d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion cli/client/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit b2e937d

Please sign in to comment.