Skip to content

Commit

Permalink
Increase HTTP client default timeout (#28)
Browse files Browse the repository at this point in the history
* Increase default timeout from 20s to 60s

* remove old comment
  • Loading branch information
jsirianni authored Jul 8, 2024
1 parent 457c1eb commit f7e17ff
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions internal/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,11 @@ import (
"go.uber.org/zap"
)

const KeyHeader = "X-Bindplane-Api-Key"
const (
KeyHeader = "X-Bindplane-Api-Key"

DefaultTimeout = time.Second * 60
)

type BindPlane struct {
logger *zap.Logger
Expand All @@ -28,7 +32,7 @@ type BindPlane struct {
func NewBindPlane(config *config.Config, logger *zap.Logger) (*BindPlane, error) {
restryClient := resty.New()
restryClient.SetDisableWarn(true)
restryClient.SetTimeout(time.Second * 20)
restryClient.SetTimeout(DefaultTimeout)

restryClient.SetBasicAuth(config.Auth.Username, config.Auth.Password)

Expand Down

0 comments on commit f7e17ff

Please sign in to comment.