Skip to content

Commit

Permalink
Use a 3 minutes timeout for /package/describe
Browse files Browse the repository at this point in the history
  • Loading branch information
bamarni committed Feb 1, 2019
1 parent fe203ea commit d9edfb5
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion pkg/internal/cosmos/client.go
Expand Up @@ -4,6 +4,7 @@ import (
"bytes"
"encoding/json"
"net/url"
"time"

"github.com/dcos/dcos-cli/pkg/httpclient"
)
Expand Down Expand Up @@ -63,7 +64,16 @@ func (c *Client) DescribePackage(name string) (*PackageInfo, error) {
return nil, err
}

req, err := c.http.NewRequest("POST", "/package/describe", &reqBody, httpclient.FailOnErrStatus(true))
req, err := c.http.NewRequest(
"POST",
"/package/describe",
&reqBody,

// Hardcode a 3 minutes timeout as Cosmos can take some time
// to respond when there are multiple configured repositories.
httpclient.Timeout(3*time.Minute),
httpclient.FailOnErrStatus(true),
)
if err != nil {
return nil, err
}
Expand Down

0 comments on commit d9edfb5

Please sign in to comment.