Skip to content

Commit

Permalink
Add const.
Browse files Browse the repository at this point in the history
  • Loading branch information
blakerouse committed Mar 11, 2021
1 parent 707edce commit 58723f6
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ import (
"github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/kibana"
)

const (
apiStatusTimeout = 15 * time.Second
)

type clientSetter interface {
SetClient(clienter)
}
Expand Down Expand Up @@ -100,7 +104,7 @@ func (h *handlerPolicyChange) handleKibanaHosts(ctx context.Context, c *config.C
err, "fail to create API client with updated hosts",
errors.TypeNetwork, errors.M("hosts", h.config.Fleet.Kibana.Hosts))
}
ctx, cancel := context.WithTimeout(ctx, 15*time.Second)
ctx, cancel := context.WithTimeout(ctx, apiStatusTimeout)
defer cancel()
_, err = client.Send(ctx, "GET", "/api/status", nil, nil, nil)
if err != nil {
Expand Down

0 comments on commit 58723f6

Please sign in to comment.