Skip to content

Commit

Permalink
fix(API): remove HTTP client timeout (#464)
Browse files Browse the repository at this point in the history
The HTTP client makes requests using the operational context passed from Terraform. The client will no longer enforce its own fixed timeout but will rely on context cancellation instead.
  • Loading branch information
bpg authored Aug 5, 2023
1 parent 5a3b1cc commit 824e51c
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions proxmox/api/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import (
"net/http"
"net/url"
"strings"
"time"

"github.com/google/go-querystring/query"
"github.com/hashicorp/terraform-plugin-log/tflog"
Expand All @@ -30,9 +29,7 @@ import (
var ErrNoDataObjectInResponse = errors.New("the server did not include a data object in the response")

const (
// the large timeout is to allow for large file uploads.
httpClientTimeout = 5 * time.Minute
basePathJSONAPI = "api2/json"
basePathJSONAPI = "api2/json"
)

// Client is an interface for performing requests against the Proxmox API.
Expand Down Expand Up @@ -93,7 +90,6 @@ func NewConnection(endpoint string, insecure bool) (*Connection, error) {
endpoint: strings.TrimRight(u.String(), "/"),
httpClient: &http.Client{
Transport: transport,
Timeout: httpClientTimeout,
},
}, nil
}
Expand Down

1 comment on commit 824e51c

@noriban
Copy link

@noriban noriban commented on 824e51c Aug 5, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

great commit, waiting for update

Please sign in to comment.